Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.51 KB

README.md

File metadata and controls

28 lines (22 loc) · 1.51 KB

CarbonAPI.Client

MIT AppVeyor Nuget

How to use

var factory = new CarbonApiClusterClientFactory(new SilentLog(), "http://url", "login", "password");

var client = factory.Create();

// Create query by tags with aggregations, alias for the last 15 min
var query = MetricTagQueryBuilder.New()
	.AddTag("event", "operations")
	.AddTag("name", "processingTime")
	.AddTag("application", "(Mercury_Vetis_Proxy)", MetricTagOperator.NotLike)
	.AddTag("_aggregate", "p95")
	.AddTag("applicationType", "(ProcessIncomingConsignment|PrepareOutgoingConsignment|GetStockEntryChangesList|GetVetDocumentChangesList)", MetricTagOperator.Like)
	.AddAggregation(new SummarizeAggregation(Period.FromMinutes((int)this.slowProcessingMovingAverage.TotalMinutes), SummarizeFunc.Min))
	.AddAggregation(new AliasByTagsAggregation("applicationType"))
	.WithPeriod(Period.FromMinutes(15))
	.Build();

// aliasByTags(summarize(seriesByTag('event=operations', 'name=processingTime', 'application!=~(Mercury_Vetis_Proxy)', '_aggregate=p95', 'applicationType=~(ProcessIncomingConsignment|PrepareOutgoingConsignment|GetStockEntryChangesList|GetVetDocumentChangesList)'),'10m', 'min', true), 'applicationType')

var result = await client.GetPointsAsync(query);