コード例 #1
0
        private void InitializeSensors()
        {
            #region Load sensors

            //Request size sensor
            _requestSizeSensor = _dataCollector.CreateParamsFuncSensor <double, double>
                                     (MonitoringConstants.RequestSizeSensorPath, "",
                                     valuesList => Math.Round(valuesList.Sum() / 45.0, 2, MidpointRounding.AwayFromZero), 45000);

            //Response size sensor
            _responseSizeSensor = _dataCollector.CreateParamsFuncSensor <double, double>
                                      (MonitoringConstants.ResponseSizeSensorPath, "",
                                      valuesList => Math.Round(valuesList.Sum() / 45.0, 2, MidpointRounding.AwayFromZero),
                                      45000);

            //Received sensors count
            _receivedSensorsSensor = _dataCollector.CreateParamsFuncSensor <double, int>(
                MonitoringConstants.SensorsCountSensorPath, "",
                valuesList => Math.Round(valuesList.Sum() / 45.0, 2, MidpointRounding.AwayFromZero),
                45000);

            //Requests count sensor
            _requestsCountSensor = _dataCollector.CreateParamsFuncSensor <double, int>(
                MonitoringConstants.RequestsCountSensorPath, "",
                valuesList => Math.Round(valuesList.Sum() / 45.0, 2, MidpointRounding.AwayFromZero),
                45000);

            #endregion

            #region Database sensors

            //Database size sensor
            _databaseSizeSensor = _dataCollector.CreateDoubleSensor(MonitoringConstants.DatabaseSizePath);

            //Monitoring data size sensor
            _monitoringDataSizeSensor = _dataCollector
                                        .CreateDoubleSensor(MonitoringConstants.MonitoringDataSizePath);

            //Environment data size sensor
            _environmentDataSizeSensor = _dataCollector
                                         .CreateDoubleSensor(MonitoringConstants.EnvironmentDataSizePath);

            #endregion
        }