public Point BuildQueueMetadata(string action, ISendResponse sendResponse, ISenderAgent senderAgent, IQueueCountInfo queueCountInfo) { var assemblyName = Assembly.GetExecutingAssembly().GetName(); var tags = new Dictionary <string, object> { { "counter", "queueCount" }, { "hostname", Environment.MachineName }, { "version", assemblyName.Version.ToString() }, { "application", assemblyName.Name }, //{ "target", senderAgent.TargetDescription }, { "isSuccess", sendResponse.IsSuccess }, { "action", action } }; if (!string.IsNullOrEmpty(sendResponse.Message)) { tags.Add("message", sendResponse.Message); } var fields = new Dictionary <string, object> { //{ "value", (decimal)sendResponse.PointCount }, { "value", (decimal)queueCountInfo.TotalQueueCount }, { "elapsed", sendResponse.Elapsed.TotalMilliseconds.ToString("0") }, { "failQueueCount", queueCountInfo.FailQueueCount }, { "totalQueueCount", queueCountInfo.TotalQueueCount }, { "queueCount", queueCountInfo.QueueCount }, { "absoluteAmountDelta", sendResponse.PointCount }, }; var point = new Point { Measurement = MetaMeasurementName, Tags = tags, Fields = fields, Precision = TimeUnit.Milliseconds, Timestamp = DateTime.UtcNow }; return(point); }
protected override void Execute(CodeActivityContext context) { ReceiveRequestSendResponseScope.Get(context).receiveRequestSendResponseScopeExecutionPropertyFactory = ISendResponse.Get(context).CreateReceiveRequestSendResponseScopeExecutionPropertyFactory(); }
public void OnTimerEvent(ISendResponse sendResponse) { _console.WriteLine($"{sendResponse.Message} in {sendResponse.Elapsed.TotalMilliseconds:N2}ms.", OutputLevel.Information); }
internal TimerEventArgs(ISendResponse sendResponse) { SendResponse = sendResponse; }
public void OnTimerEvent(ISendResponse sendResponse) { TimerEvent?.Invoke(this, new TimerEventArgs(sendResponse)); }
public void OnTimerEvent(ISendResponse sendResponse) { }