Source/NFX/Glue/Transport.cs
/// <summary>
/// Override to dump instrumentation data, dont forget to call base to dump basic metrics
/// </summary>
Override to dump instrumentation data, dont forget to call base to dump basic metrics
Override to dump instrumentation data dont forget to call base to dump basic metrics
protected virtual void DoDumpInstrumentationData()
            {
              var delta_StatBytesReceived = m_StatBytesReceived - m_Prev_StatBytesReceived; m_Prev_StatBytesReceived = m_StatBytesReceived;
              var delta_StatBytesSent     = m_StatBytesSent     - m_Prev_StatBytesSent;     m_Prev_StatBytesSent     = m_StatBytesSent;
              var delta_StatMsgReceived   = m_StatMsgReceived   - m_Prev_StatMsgReceived;   m_Prev_StatMsgReceived   = m_StatMsgReceived;
              var delta_StatMsgSent       = m_StatMsgSent       - m_Prev_StatMsgSent;       m_Prev_StatMsgSent       = m_StatMsgSent;
              var delta_StatErrors        = m_StatErrors        - m_Prev_StatErrors;        m_Prev_StatErrors        = m_StatErrors;
              var node = Node;
              var entropySample = (delta_StatBytesReceived << (int)(delta_StatMsgReceived%27)) ^
                                  (delta_StatBytesSent << (int)(delta_StatMsgSent%19)) ^
                                  (delta_StatMsgReceived << 3) ^
                                  (delta_StatMsgSent << 5) ^
                                  (delta_StatErrors);
              if (entropySample!=0)
                NFX.ExternalRandomGenerator.Instance.FeedExternalEntropySample((int)entropySample);
              if (this is ClientTransport)
              {
                 Instrumentation.ClientBytesReceived.Record(node, delta_StatBytesReceived);
                 Instrumentation.ClientBytesSent    .Record(node, delta_StatBytesSent);
                 Instrumentation.ClientMsgReceived  .Record(node, delta_StatMsgReceived);
                 Instrumentation.ClientMsgSent      .Record(node, delta_StatMsgSent);
                 Instrumentation.ClientErrors       .Record(node, delta_StatErrors);
                 Instrumentation.ClientTotalBytesReceived.Record(node, m_StatBytesReceived);
                 Instrumentation.ClientTotalBytesSent    .Record(node, m_StatBytesSent);
                 Instrumentation.ClientTotalMsgReceived  .Record(node, m_StatMsgReceived);
                 Instrumentation.ClientTotalMsgSent      .Record(node, m_StatMsgSent);
                 Instrumentation.ClientTotalErrors       .Record(node, m_StatErrors);
                 if (Binding.MeasureStatTimes)
                  foreach(var kvp in m_StatTimes)
                    Instrumentation.ClientCallRoundtripTime.Record(kvp.Key, kvp.Value * 1000);
              }
              else
              {
                 Instrumentation.ServerBytesReceived.Record(node, delta_StatBytesReceived);
                 Instrumentation.ServerBytesSent    .Record(node, delta_StatBytesSent);
                 Instrumentation.ServerMsgReceived  .Record(node, delta_StatMsgReceived);
                 Instrumentation.ServerMsgSent      .Record(node, delta_StatMsgSent);
                 Instrumentation.ServerErrors       .Record(node, delta_StatErrors);
                 Instrumentation.ServerTotalBytesReceived.Record(node, m_StatBytesReceived);
                 Instrumentation.ServerTotalBytesSent    .Record(node, m_StatBytesSent);
                 Instrumentation.ServerTotalMsgReceived  .Record(node, m_StatMsgReceived);
                 Instrumentation.ServerTotalMsgSent      .Record(node, m_StatMsgSent);
                 Instrumentation.ServerTotalErrors       .Record(node, m_StatErrors);
              }
            }
protected virtual void DoDumpInstrumentationData ( ) { var delta_StatBytesReceived = m_StatBytesReceived - m_Prev_StatBytesReceived ; m_Prev_StatBytesReceived = m_StatBytesReceived ; var delta_StatBytesSent = m_StatBytesSent - m_Prev_StatBytesSent ; m_Prev_StatBytesSent = m_StatBytesSent ; var delta_StatMsgReceived = m_StatMsgReceived - m_Prev_StatMsgReceived ; m_Prev_StatMsgReceived = m_StatMsgReceived ; var delta_StatMsgSent = m_StatMsgSent - m_Prev_StatMsgSent ; m_Prev_StatMsgSent = m_StatMsgSent ; var delta_StatErrors = m_StatErrors - m_Prev_StatErrors ; m_Prev_StatErrors = m_StatErrors ; var node = Node ; var entropySample = ( delta_StatBytesReceived << ( int ) ( delta_StatMsgReceived % 27 ) ) ^ ( delta_StatBytesSent << ( int ) ( delta_StatMsgSent % 19 ) ) ^ ( delta_StatMsgReceived << 3 ) ^ ( delta_StatMsgSent << 5 ) ^ ( delta_StatErrors ) ; if ( entropySample != 0 ) NFX . ExternalRandomGenerator . Instance . FeedExternalEntropySample ( ( int ) entropySample ) ; if ( this is ClientTransport ) { Instrumentation . ClientBytesReceived . Record ( node , delta_StatBytesReceived ) ; Instrumentation . ClientBytesSent . Record ( node , delta_StatBytesSent ) ; Instrumentation . ClientMsgReceived . Record ( node , delta_StatMsgReceived ) ; Instrumentation . ClientMsgSent . Record ( node , delta_StatMsgSent ) ; Instrumentation . ClientErrors . Record ( node , delta_StatErrors ) ; Instrumentation . ClientTotalBytesReceived . Record ( node , m_StatBytesReceived ) ; Instrumentation . ClientTotalBytesSent . Record ( node , m_StatBytesSent ) ; Instrumentation . ClientTotalMsgReceived . Record ( node , m_StatMsgReceived ) ; Instrumentation . ClientTotalMsgSent . Record ( node , m_StatMsgSent ) ; Instrumentation . ClientTotalErrors . Record ( node , m_StatErrors ) ; if ( Binding . MeasureStatTimes ) foreach ( var kvp in m_StatTimes ) Instrumentation . ClientCallRoundtripTime . Record ( kvp . Key , kvp . Value * 1000 ) ; } else { Instrumentation . ServerBytesReceived . Record ( node , delta_StatBytesReceived ) ; Instrumentation . ServerBytesSent . Record ( node , delta_StatBytesSent ) ; Instrumentation . ServerMsgReceived . Record ( node , delta_StatMsgReceived ) ; Instrumentation . ServerMsgSent . Record ( node , delta_StatMsgSent ) ; Instrumentation . ServerErrors . Record ( node , delta_StatErrors ) ; Instrumentation . ServerTotalBytesReceived . Record ( node , m_StatBytesReceived ) ; Instrumentation . ServerTotalBytesSent . Record ( node , m_StatBytesSent ) ; Instrumentation . ServerTotalMsgReceived . Record ( node , m_StatMsgReceived ) ; Instrumentation . ServerTotalMsgSent . Record ( node , m_StatMsgSent ) ; Instrumentation . ServerTotalErrors . Record ( node , m_StatErrors ) ; } }
Override to dump instrumentation data, dont forget to call base to dump basic metrics
Override to dump instrumentation data dont forget to call base to dump basic metrics
//Introduce entropy into random generator //Value is in sec, but gauge measures in milliseconds