Metricity 1.0.0.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Metricity --version 1.0.0.3
NuGet\Install-Package Metricity -Version 1.0.0.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Metricity" Version="1.0.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Metricity --version 1.0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Metricity, 1.0.0.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Metricity as a Cake Addin #addin nuget:?package=Metricity&version=1.0.0.3 // Install Metricity as a Cake Tool #tool nuget:?package=Metricity&version=1.0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Metricity
Metric and diagnostic utilities for .Net
Installation
Available on Nuget.
pm> Install-Package Metricity
Getting Started
Coming Soon...
Usage
//Returns time taken for execution of synchronous code
var syncTime = Metricity.Timings.Time(() =>
{
SyncMethod();
});
//Returns time taken for execution of asynchronous code
var asyncTime = Metricity.Timings.Time(async () =>
{
await ASyncMethod();
});
//Returns current memory usage of application
var memoryUsage = Metricity.Diagnostics.GetMemoryUsage();
//Returns current cpu usage of application
var cpuUsage = Metricity.Diagnostics.GetCPUUsage();
//Returns difference in memory usage from before synchronous code execution and after
var memoryChangeSync = Metricity.Diagnostics.GetMemoryChange(() =>
{
SyncMethod();
});
//Returns difference in memory usage from before asynchronous code execution and after
ar memoryChangeASync = Metricity.Diagnostics.GetMemoryChange(async () =>
{
await ASyncMethod();
});
//Logs time taken for execution of synchronous code to database
Metricity.RemoteLog.Log(() =>
{
SyncMethod();
});
//Logs time taken for execution of asynchronous code to database
await Metricity.RemoteLog.Log(async () =>
{
await ASyncMethod();
});
//Logs time taken for execution of synchronous code to cache, cache is then commited to database when CommitCache is called
Metricity.RemoteLog.CacheLog(() =>
{
SyncMethod();
});
//Logs time taken for execution of synchronous code to cache, cache is then commited to database when CommitCache is called
await Metricity.RemoteLog.CacheLog(async () =>
{
await ASyncMethod();
});
//Clears all metrics from the cache
Metricity.RemoteLog.ClearCache();
//Returns the current cache
var cache = Metricity.RemoteLog.GetCache();
//Commits cache to database
Metricity.RemoteLog.CommitCache();
//Increments the counter by one
Metricity.Counters.Increment("counter");
//Decrements the counter by one
Metricity.Counters.Decrement("counter");
//Returns the count of the specified counter
Metricity.Counters.GetCurrentCount("counter");
//Resets the specified counter
Metricity.Counters.ClearCounter("counter");
//Resets all counters
Metricity.Counters.PurgeCounters();
//Gets the percentage splits of subset counters
var splits = Metricity.Counters.GetSubsetSplit("counter");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- EntityFramework (>= 6.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.