コード例 #1
0
        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);
        }
コード例 #2
0
 protected override void Execute(CodeActivityContext context)
 {
     ReceiveRequestSendResponseScope.Get(context).receiveRequestSendResponseScopeExecutionPropertyFactory =
         ISendResponse.Get(context).CreateReceiveRequestSendResponseScopeExecutionPropertyFactory();
 }
コード例 #3
0
 public void OnTimerEvent(ISendResponse sendResponse)
 {
     _console.WriteLine($"{sendResponse.Message} in {sendResponse.Elapsed.TotalMilliseconds:N2}ms.", OutputLevel.Information);
 }
コード例 #4
0
 internal TimerEventArgs(ISendResponse sendResponse)
 {
     SendResponse = sendResponse;
 }
コード例 #5
0
 public void OnTimerEvent(ISendResponse sendResponse)
 {
     TimerEvent?.Invoke(this, new TimerEventArgs(sendResponse));
 }
コード例 #6
0
 public void OnTimerEvent(ISendResponse sendResponse)
 {
 }