Unified · Split
| @@ -23,183 +23,108 @@ · 22 unmodified lines | |||
| 23 | // | 23 | // |
| 24 | //****************************************************************************************************** | 24 | //****************************************************************************************************** |
| 25 | 25 | ||
| 26 | using System; | ||
| 27 | using System.Reflection; | ||
| 26 | using GSF.TimeSeries.Transport; | 28 | using GSF.TimeSeries.Transport; |
| 29 | using GSF.Units; | ||
| 27 | 30 | ||
| 28 | // ReSharper disable UnusedParameter.Local | 31 | // ReSharper disable UnusedParameter.Local |
| 29 | namespace GSF.TimeSeries.Statistics | 32 | namespace GSF.TimeSeries.Statistics |
| 30 | { | 33 | { |
| 31 | internal static class GatewayStatistics | 34 | internal static class GatewayStatistics |
| 32 | { | 35 | { |
| 33 | #region [ Subscriber Statistics ] | 36 | private static T GetPropertyValue<T>(object source, string name) |
| 37 | { | ||
| 38 | PropertyInfo property = source.GetType().GetProperty(name); | ||
| 39 | return property != null ? (T)property.GetValue(source) : default(T); | ||
| 40 | } | ||
| 34 | 41 | ||
| 35 | private static double GetSubscriberStatistic_Connected(object source, string arguments) | 42 | private static T GetFunctionValue<T>(object source, string name, params object[] parameters) |
| 36 | { | 43 | { |
| 37 | double statistic = 0.0D; | 44 | MethodInfo method = source.GetType().GetMethod(name); |
| 38 | DataSubscriber subscriber = source as DataSubscriber; | 45 | return method != null ? (T)method.Invoke(source, parameters) : default(T); |
| 46 | } | ||
| 39 | 47 | ||
| 40 | if ((object)subscriber != null) | 48 | #region [ Subscriber Statistics ] |
| 41 | statistic = subscriber.IsConnected ? 1.0D : 0.0D; | ||
| 42 | 49 | ||
| 43 | return statistic; | 50 | private static double GetSubscriberStatistic_Connected(object source, string arguments) |
| 51 | { | ||
| 52 | return (source is DataSubscriber subscriber ? subscriber.IsConnected : GetPropertyValue<bool>(source, "IsConnected")) ? 1.0D : 0.0D; | ||
| 44 | } | 53 | } |
| 45 | 54 | ||
| 46 | private static double GetSubscriberStatistic_Authenticated(object source, string arguments) | 55 | private static double GetSubscriberStatistic_Authenticated(object source, string arguments) |
| 47 | { | 56 | { |
| 48 | double statistic = 0.0D; | 57 | return (source is DataSubscriber subscriber ? subscriber.Authenticated : GetPropertyValue<bool>(source, "Authenticated")) ? 1.0D : 0.0D; |
| 49 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 50 | |||
| 51 | if ((object)subscriber != null) | ||
| 52 | statistic = subscriber.Authenticated ? 1.0D : 0.0D; | ||
| 53 | |||
| 54 | return statistic; | ||
| 55 | } | 58 | } |
| 56 | 59 | ||
| 57 | private static double GetSubscriberStatistic_ProcessedMeasurements(object source, string arguments) | 60 | private static double GetSubscriberStatistic_ProcessedMeasurements(object source, string arguments) |
| 58 | { | 61 | { |
| 59 | double statistic = 0.0D; | 62 | double statistic = source is DataSubscriber subscriber ? subscriber.ProcessedMeasurements : GetPropertyValue<long>(source, "ProcessedMeasurements"); |
| 60 | DataSubscriber subscriber = source as DataSubscriber; | 63 | return s_statisticValueCache.GetDifference(source, statistic, "ProcessedMeasurements"); |
| 61 | |||
| 62 | if ((object)subscriber != null) | ||
| 63 | statistic = s_statisticValueCache.GetDifference(subscriber, subscriber.ProcessedMeasurements, "ProcessedMeasurements"); | ||
| 64 | |||
| 65 | return statistic; | ||
| 66 | } | 64 | } |
| 67 | 65 | ||
| 68 | private static double GetSubscriberStatistic_TotalBytesReceived(object source, string arguments) | 66 | private static double GetSubscriberStatistic_TotalBytesReceived(object source, string arguments) |
| 69 | { | 67 | { |
| 70 | double statistic = 0.0D; | 68 | double statistic = source is DataSubscriber subscriber ? subscriber.TotalBytesReceived : GetPropertyValue<long>(source, "TotalBytesReceived"); |
| 71 | DataSubscriber subscriber = source as DataSubscriber; | 69 | double difference = s_statisticValueCache.GetDifference(source, statistic, "TotalBytesReceived"); |
| 72 | 70 | return difference < 0.0D ? statistic : difference; | |
| 73 | if ((object)subscriber != null) | ||
| 74 | { | ||
| 75 | statistic = s_statisticValueCache.GetDifference(subscriber, subscriber.TotalBytesReceived, "TotalBytesReceived"); | ||
| 76 | |||
| 77 | if (statistic < 0.0D) | ||
| 78 | statistic = subscriber.TotalBytesReceived; | ||
| 79 | } | ||
| 80 | |||
| 81 | return statistic; | ||
| 82 | } | 71 | } |
| 83 | 72 | ||
| 84 | private static double GetSubscriberStatistic_AuthorizedCount(object source, string arguments) | 73 | private static double GetSubscriberStatistic_AuthorizedCount(object source, string arguments) |
| 85 | { | 74 | { |
| 86 | double statistic = 0.0D; | 75 | Guid[] authorizedSignalIDs = source is DataSubscriber subscriber ? subscriber.GetAuthorizedSignalIDs() : GetFunctionValue<Guid[]>(source, "GetAuthorizedSignalIDs"); |
| 87 | DataSubscriber subscriber = source as DataSubscriber; | 76 | return authorizedSignalIDs?.Length ?? 0; |
| 88 | |||
| 89 | if ((object)subscriber != null) | ||
| 90 | statistic = subscriber.GetAuthorizedSignalIDs().Length; | ||
| 91 | |||
| 92 | return statistic; | ||
| 93 | } | 77 | } |
| 94 | 78 | ||
| 95 | private static double GetSubscriberStatistic_UnauthorizedCount(object source, string arguments) | 79 | private static double GetSubscriberStatistic_UnauthorizedCount(object source, string arguments) |
| 96 | { | 80 | { |
| 97 | double statistic = 0.0D; | 81 | Guid[] unauthorizedSignalIDs = source is DataSubscriber subscriber ? subscriber.GetUnauthorizedSignalIDs() : GetFunctionValue<Guid[]>(source, "GetUnauthorizedSignalIDs"); |
| 98 | DataSubscriber subscriber = source as DataSubscriber; | 82 | return unauthorizedSignalIDs?.Length ?? 0; |
| 99 | |||
| 100 | if ((object)subscriber != null) | ||
| 101 | statistic = subscriber.GetUnauthorizedSignalIDs().Length; | ||
| 102 | |||
| 103 | return statistic; | ||
| 104 | } | 83 | } |
| 105 | 84 | ||
| 106 | private static double GetSubscriberStatistic_LifetimeMeasurements(object source, string arguments) | 85 | private static double GetSubscriberStatistic_LifetimeMeasurements(object source, string arguments) |
| 107 | { | 86 | { |
| 108 | double statistic = 0.0D; | 87 | return source is DataSubscriber subscriber ? subscriber.LifetimeMeasurements : GetPropertyValue<long>(source, "LifetimeMeasurements"); |
| 109 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 110 | |||
| 111 | if ((object)subscriber != null) | ||
| 112 | statistic = subscriber.LifetimeMeasurements; | ||
| 113 | |||
| 114 | return statistic; | ||
| 115 | } | 88 | } |
| 116 | 89 | ||
| 117 | private static double GetSubscriberStatistic_MinimumMeasurementsPerSecond(object source, string arguments) | 90 | private static double GetSubscriberStatistic_MinimumMeasurementsPerSecond(object source, string arguments) |
| 118 | { | 91 | { |
| 119 | double statistic = 0.0D; | 92 | return source is DataSubscriber subscriber ? subscriber.MinimumMeasurementsPerSecond : GetPropertyValue<long>(source, "MinimumMeasurementsPerSecond"); |
| 120 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 121 | |||
| 122 | if ((object)subscriber != null) | ||
| 123 | statistic = subscriber.MinimumMeasurementsPerSecond; | ||
| 124 | |||
| 125 | return statistic; | ||
| 126 | } | 93 | } |
| 127 | 94 | ||
| 128 | private static double GetSubscriberStatistic_MaximumMeasurementsPerSecond(object source, string arguments) | 95 | private static double GetSubscriberStatistic_MaximumMeasurementsPerSecond(object source, string arguments) |
| 129 | { | 96 | { |
| 130 | double statistic = 0.0D; | 97 | return source is DataSubscriber subscriber ? subscriber.MaximumMeasurementsPerSecond : GetPropertyValue<long>(source, "MaximumMeasurementsPerSecond"); |
| 131 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 132 | |||
| 133 | if ((object)subscriber != null) | ||
| 134 | statistic = subscriber.MaximumMeasurementsPerSecond; | ||
| 135 | |||
| 136 | return statistic; | ||
| 137 | } | 98 | } |
| 138 | 99 | ||
| 139 | private static double GetSubscriberStatistic_AverageMeasurementsPerSecond(object source, string arguments) | 100 | private static double GetSubscriberStatistic_AverageMeasurementsPerSecond(object source, string arguments) |
| 140 | { | 101 | { |
| 141 | double statistic = 0.0D; | 102 | return source is DataSubscriber subscriber ? subscriber.AverageMeasurementsPerSecond : GetPropertyValue<long>(source, "AverageMeasurementsPerSecond"); |
| 142 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 143 | |||
| 144 | if ((object)subscriber != null) | ||
| 145 | statistic = subscriber.AverageMeasurementsPerSecond; | ||
| 146 | |||
| 147 | return statistic; | ||
| 148 | } | 103 | } |
| 149 | 104 | ||
| 150 | private static double GetSubscriberStatistic_LifetimeBytesReceived(object source, string arguments) | 105 | private static double GetSubscriberStatistic_LifetimeBytesReceived(object source, string arguments) |
| 151 | { | 106 | { |
| 152 | double statistic = 0.0D; | 107 | return source is DataSubscriber subscriber ? subscriber.TotalBytesReceived : GetPropertyValue<long>(source, "TotalBytesReceived"); |
| 153 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 154 | |||
| 155 | if ((object)subscriber != null) | ||
| 156 | statistic = subscriber.TotalBytesReceived; | ||
| 157 | |||
| 158 | return statistic; | ||
| 159 | } | 108 | } |
| 160 | 109 | ||
| 161 | private static double GetSubscriberStatistic_LifetimeMinimumLatency(object source, string arguments) | 110 | private static double GetSubscriberStatistic_LifetimeMinimumLatency(object source, string arguments) |
| 162 | { | 111 | { |
| 163 | double statistic = 0.0D; | 112 | return source is DataSubscriber subscriber ? subscriber.LifetimeMinimumLatency : GetPropertyValue<int>(source, "LifetimeMinimumLatency"); |
| 164 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 165 | |||
| 166 | if ((object)subscriber != null) | ||
| 167 | statistic = subscriber.LifetimeMinimumLatency; | ||
| 168 | |||
| 169 | return statistic; | ||
| 170 | } | 113 | } |
| 171 | 114 | ||
| 172 | private static double GetSubscriberStatistic_LifetimeMaximumLatency(object source, string arguments) | 115 | private static double GetSubscriberStatistic_LifetimeMaximumLatency(object source, string arguments) |
| 173 | { | 116 | { |
| 174 | double statistic = 0.0D; | 117 | return source is DataSubscriber subscriber ? subscriber.LifetimeMaximumLatency : GetPropertyValue<int>(source, "LifetimeMaximumLatency"); |
| 175 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 176 | |||
| 177 | if ((object)subscriber != null) | ||
| 178 | statistic = subscriber.LifetimeMaximumLatency; | ||
| 179 | |||
| 180 | return statistic; | ||
| 181 | } | 118 | } |
| 182 | 119 | ||
| 183 | private static double GetSubscriberStatistic_LifetimeAverageLatency(object source, string arguments) | 120 | private static double GetSubscriberStatistic_LifetimeAverageLatency(object source, string arguments) |
| 184 | { | 121 | { |
| 185 | double statistic = 0.0D; | 122 | return source is DataSubscriber subscriber ? subscriber.LifetimeAverageLatency : GetPropertyValue<int>(source, "LifetimeAverageLatency"); |
| 186 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 187 | |||
| 188 | if ((object)subscriber != null) | ||
| 189 | statistic = subscriber.LifetimeAverageLatency; | ||
| 190 | |||
| 191 | return statistic; | ||
| 192 | } | 123 | } |
| 193 | 124 | ||
| 194 | private static double GetSubscriberStatistic_UpTime(object source, string arguments) | 125 | private static double GetSubscriberStatistic_UpTime(object source, string arguments) |
| 195 | { | 126 | { |
| 196 | double statistic = 0.0D; | 127 | return source is DataSubscriber subscriber ? subscriber.RunTime : GetPropertyValue<Time>(source, "RunTime"); |
| 197 | DataSubscriber subscriber = source as DataSubscriber; | ||
| 198 | |||
| 199 | if ((object)subscriber != null) | ||
| 200 | statistic = subscriber.RunTime; | ||
| 201 | |||
| 202 | return statistic; | ||
| 203 | } | 128 | } |
| 204 | 129 | ||
| 205 | #endregion | 130 | #endregion |
| @@ -208,161 +133,76 @@ namespace GSF.TimeSeries.Statistics · 2 unmodified lines | |||
| 208 | 133 | ||
| 209 | private static double GetPublisherStatistic_Connected(object source, string arguments) | 134 | private static double GetPublisherStatistic_Connected(object source, string arguments) |
| 210 | { | 135 | { |
| 211 | double statistic = 0.0D; | 136 | return (source is DataPublisher publisher ? publisher.IsConnected : GetPropertyValue<bool>(source, "IsConnected")) ? 1.0D : 0.0D; |
| 212 | DataPublisher publisher = source as DataPublisher; | ||
| 213 | |||
| 214 | if ((object)publisher != null) | ||
| 215 | statistic = publisher.IsConnected ? 1.0D : 0.0D; | ||
| 216 | |||
| 217 | return statistic; | ||
| 218 | } | 137 | } |
| 219 | 138 | ||
| 220 | private static double GetPublisherStatistic_ConnectedClientCount(object source, string arguments) | 139 | private static double GetPublisherStatistic_ConnectedClientCount(object source, string arguments) |
| 221 | { | 140 | { |
| 222 | double statistic = 0.0D; | 141 | return source is DataPublisher publisher ? publisher.Count : GetPropertyValue<int>(source, "Count"); |
| 223 | DataPublisher publisher = source as DataPublisher; | ||
| 224 | |||
| 225 | if ((object)publisher != null) | ||
| 226 | statistic = publisher.Count; | ||
| 227 | |||
| 228 | return statistic; | ||
| 229 | } | 142 | } |
| 230 | 143 | ||
| 231 | private static double GetPublisherStatistic_ProcessedMeasurements(object source, string arguments) | 144 | private static double GetPublisherStatistic_ProcessedMeasurements(object source, string arguments) |
| 232 | { | 145 | { |
| 233 | double statistic = 0.0D; | 146 | double statistic = source is DataPublisher publisher ? publisher.ProcessedMeasurements : GetPropertyValue<long>(source, "ProcessedMeasurements"); |
| 234 | DataPublisher publisher = source as DataPublisher; | 147 | return s_statisticValueCache.GetDifference(source, statistic, "ProcessedMeasurements"); |
| 235 | |||
| 236 | if ((object)publisher != null) | ||
| 237 | statistic = s_statisticValueCache.GetDifference(publisher, publisher.ProcessedMeasurements, "ProcessedMeasurements"); | ||
| 238 | |||
| 239 | return statistic; | ||
| 240 | } | 148 | } |
| 241 | 149 | ||
| 242 | private static double GetPublisherStatistic_TotalBytesSent(object source, string arguments) | 150 | private static double GetPublisherStatistic_TotalBytesSent(object source, string arguments) |
| 243 | { | 151 | { |
| 244 | double statistic = 0.0D; | 152 | double statistic = source is DataPublisher publisher ? publisher.TotalBytesSent : GetPropertyValue<long>(source, "TotalBytesSent"); |
| 245 | DataPublisher publisher = source as DataPublisher; | 153 | double difference = s_statisticValueCache.GetDifference(source, statistic, "TotalBytesSent"); |
| 246 | 154 | return difference < 0.0D ? statistic : difference; | |
| 247 | if ((object)publisher != null) | ||
| 248 | { | ||
| 249 | statistic = s_statisticValueCache.GetDifference(publisher, publisher.TotalBytesSent, "TotalBytesSent"); | ||
| 250 | |||
| 251 | if (statistic < 0.0D) | ||
| 252 | statistic = publisher.TotalBytesSent; | ||
| 253 | } | ||
| 254 | |||
| 255 | return statistic; | ||
| 256 | } | 155 | } |
| 257 | 156 | ||
| 258 | private static double GetPublisherStatistic_LifetimeMeasurements(object source, string arguments) | 157 | private static double GetPublisherStatistic_LifetimeMeasurements(object source, string arguments) |
| 259 | { | 158 | { |
| 260 | double statistic = 0.0D; | 159 | return source is DataPublisher publisher ? publisher.LifetimeMeasurements : GetPropertyValue<long>(source, "LifetimeMeasurements"); |
| 261 | DataPublisher publisher = source as DataPublisher; | ||
| 262 | |||
| 263 | if ((object)publisher != null) | ||
| 264 | statistic = publisher.LifetimeMeasurements; | ||
| 265 | |||
| 266 | return statistic; | ||
| 267 | } | 160 | } |
| 268 | 161 | ||
| 269 | private static double GetPublisherStatistic_MinimumMeasurementsPerSecond(object source, string arguments) | 162 | private static double GetPublisherStatistic_MinimumMeasurementsPerSecond(object source, string arguments) |
| 270 | { | 163 | { |
| 271 | double statistic = 0.0D; | 164 | return source is DataPublisher publisher ? publisher.MinimumMeasurementsPerSecond : GetPropertyValue<long>(source, "MinimumMeasurementsPerSecond"); |
| 272 | DataPublisher publisher = source as DataPublisher; | ||
| 273 | |||
| 274 | if ((object)publisher != null) | ||
| 275 | statistic = publisher.MinimumMeasurementsPerSecond; | ||
| 276 | |||
| 277 | return statistic; | ||
| 278 | } | 165 | } |
| 279 | 166 | ||
| 280 | private static double GetPublisherStatistic_MaximumMeasurementsPerSecond(object source, string arguments) | 167 | private static double GetPublisherStatistic_MaximumMeasurementsPerSecond(object source, string arguments) |
| 281 | { | 168 | { |
| 282 | double statistic = 0.0D; | 169 | return source is DataPublisher publisher ? publisher.MaximumMeasurementsPerSecond : GetPropertyValue<long>(source, "MaximumMeasurementsPerSecond"); |
| 283 | DataPublisher publisher = source as DataPublisher; | ||
| 284 | |||
| 285 | if ((object)publisher != null) | ||
| 286 | statistic = publisher.MaximumMeasurementsPerSecond; | ||
| 287 | |||
| 288 | return statistic; | ||
| 289 | } | 170 | } |
| 290 | 171 | ||
| 291 | private static double GetPublisherStatistic_AverageMeasurementsPerSecond(object source, string arguments) | 172 | private static double GetPublisherStatistic_AverageMeasurementsPerSecond(object source, string arguments) |
| 292 | { | 173 | { |
| 293 | double statistic = 0.0D; | 174 | return source is DataPublisher publisher ? publisher.AverageMeasurementsPerSecond : GetPropertyValue<long>(source, "AverageMeasurementsPerSecond"); |
| 294 | DataPublisher publisher = source as DataPublisher; | ||
| 295 | |||
| 296 | if ((object)publisher != null) | ||
| 297 | statistic = publisher.AverageMeasurementsPerSecond; | ||
| 298 | |||
| 299 | return statistic; | ||
| 300 | } | 175 | } |
| 301 | 176 | ||
| 302 | private static double GetPublisherStatistic_LifetimeBytesSent(object source, string arguments) | 177 | private static double GetPublisherStatistic_LifetimeBytesSent(object source, string arguments) |
| 303 | { | 178 | { |
| 304 | double statistic = 0.0D; | 179 | return source is DataPublisher publisher ? publisher.TotalBytesSent : GetPropertyValue<long>(source, "TotalBytesSent"); |
| 305 | DataPublisher publisher = source as DataPublisher; | ||
| 306 | |||
| 307 | if ((object)publisher != null) | ||
| 308 | statistic = publisher.TotalBytesSent; | ||
| 309 | |||
| 310 | return statistic; | ||
| 311 | } | 180 | } |
| 312 | 181 | ||
| 313 | private static double GetPublisherStatistic_LifetimeMinimumLatency(object source, string arguments) | 182 | private static double GetPublisherStatistic_LifetimeMinimumLatency(object source, string arguments) |
| 314 | { | 183 | { |
| 315 | double statistic = 0.0D; | 184 | return source is DataPublisher publisher ? publisher.LifetimeMinimumLatency : GetPropertyValue<int>(source, "LifetimeMinimumLatency"); |
| 316 | DataPublisher publisher = source as DataPublisher; | ||
| 317 | |||
| 318 | if ((object)publisher != null) | ||
| 319 | statistic = publisher.LifetimeMinimumLatency; | ||
| 320 | |||
| 321 | return statistic; | ||
| 322 | } | 185 | } |
| 323 | 186 | ||
| 324 | private static double GetPublisherStatistic_LifetimeMaximumLatency(object source, string arguments) | 187 | private static double GetPublisherStatistic_LifetimeMaximumLatency(object source, string arguments) |
| 325 | { | 188 | { |
| 326 | double statistic = 0.0D; | 189 | return source is DataPublisher publisher ? publisher.LifetimeMaximumLatency : GetPropertyValue<int>(source, "LifetimeMaximumLatency"); |
| 327 | DataPublisher publisher = source as DataPublisher; | ||
| 328 | |||
| 329 | if ((object)publisher != null) | ||
| 330 | statistic = publisher.LifetimeMaximumLatency; | ||
| 331 | |||
| 332 | return statistic; | ||
| 333 | } | 190 | } |
| 334 | 191 | ||
| 335 | private static double GetPublisherStatistic_LifetimeAverageLatency(object source, string arguments) | 192 | private static double GetPublisherStatistic_LifetimeAverageLatency(object source, string arguments) |
| 336 | { | 193 | { |
| 337 | double statistic = 0.0D; | 194 | return source is DataPublisher publisher ? publisher.LifetimeAverageLatency : GetPropertyValue<int>(source, "LifetimeAverageLatency"); |
| 338 | DataPublisher publisher = source as DataPublisher; | ||
| 339 | |||
| 340 | if ((object)publisher != null) | ||
| 341 | statistic = publisher.LifetimeAverageLatency; | ||
| 342 | |||
| 343 | return statistic; | ||
| 344 | } | 195 | } |
| 345 | 196 | ||
| 346 | private static double GetPublisherStatistic_BufferBlockRetransmissions(object source, string arguments) | 197 | private static double GetPublisherStatistic_BufferBlockRetransmissions(object source, string arguments) |
| 347 | { | 198 | { |
| 348 | double statistic = 0.0D; | 199 | double statistic = source is DataPublisher publisher ? publisher.BufferBlockRetransmissions : GetPropertyValue<long>(source, "BufferBlockRetransmissions"); |
| 349 | DataPublisher publisher = source as DataPublisher; | 200 | return s_statisticValueCache.GetDifference(source, statistic, "BufferBlockRetransmissions"); |
| 350 | |||
| 351 | if ((object)publisher != null) | ||
| 352 | statistic = s_statisticValueCache.GetDifference(publisher, publisher.BufferBlockRetransmissions, "BufferBlockRetransmissions"); | ||
| 353 | |||
| 354 | return statistic; | ||
| 355 | } | 201 | } |
| 356 | 202 | ||
| 357 | private static double GetPublisherStatistic_UpTime(object source, string arguments) | 203 | private static double GetPublisherStatistic_UpTime(object source, string arguments) |
| 358 | { | 204 | { |
| 359 | double statistic = 0.0D; | 205 | return source is DataPublisher publisher ? publisher.RunTime : GetPropertyValue<Time>(source, "RunTime"); |
| 360 | DataPublisher publisher = source as DataPublisher; | ||
| 361 | |||
| 362 | if ((object)publisher != null) | ||
| 363 | statistic = publisher.RunTime; | ||
| 364 | |||
| 365 | return statistic; | ||
| 366 | } | 206 | } |
| 367 | 207 | ||
| 368 | #endregion | 208 | #endregion |