1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-03-26 17:44:24 -04:00
Files
Radarr/src/Microsoft.AspNet.SignalR.Core/Infrastructure/PerformanceCounterWrapper.cs
Mark McDowall a9ada8fcf1 Cleanup tabs
2015-06-21 22:56:00 -07:00

69 lines
1.5 KiB
C#

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
using System;
using System.Diagnostics;
namespace Microsoft.AspNet.SignalR.Infrastructure
{
internal class PerformanceCounterWrapper : IPerformanceCounter
{
private readonly PerformanceCounter _counter;
public PerformanceCounterWrapper(PerformanceCounter counter)
{
_counter = counter;
}
public string CounterName
{
get
{
return _counter.CounterName;
}
}
public long RawValue
{
get { return _counter.RawValue; }
set { _counter.RawValue = value; }
}
public long Decrement()
{
return _counter.Decrement();
}
public long Increment()
{
return _counter.Increment();
}
public long IncrementBy(long value)
{
return _counter.IncrementBy(value);
}
public void Close()
{
_counter.Close();
}
public void RemoveInstance()
{
try
{
_counter.RemoveInstance();
}
catch(NotImplementedException)
{
// This happens on mono
}
}
public CounterSample NextSample()
{
return _counter.NextSample();
}
}
}