Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Engine/OrthancPlugins.cpp @ 5337:b376abae664a
Metrics can be stored either as floating-point numbers, or as integers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 27 Jun 2023 17:55:09 +0200 |
parents | f5cb6310e0dc |
children | 3c8286e5d07b 0e5e675b9750 |
comparison
equal
deleted
inserted
replaced
5336:dd9795dc380d | 5337:b376abae664a |
---|---|
5297 const _OrthancPluginSetMetricsValue& p = | 5297 const _OrthancPluginSetMetricsValue& p = |
5298 *reinterpret_cast<const _OrthancPluginSetMetricsValue*>(parameters); | 5298 *reinterpret_cast<const _OrthancPluginSetMetricsValue*>(parameters); |
5299 | 5299 |
5300 { | 5300 { |
5301 PImpl::ServerContextLock lock(*pimpl_); | 5301 PImpl::ServerContextLock lock(*pimpl_); |
5302 lock.GetContext().GetMetricsRegistry().SetValue(p.name, boost::math::llround(p.value), | 5302 lock.GetContext().GetMetricsRegistry().SetFloatValue(p.name, p.value, Plugins::Convert(p.type)); |
5303 Plugins::Convert(p.type)); | |
5304 } | 5303 } |
5305 | 5304 |
5306 return true; | 5305 return true; |
5307 } | 5306 } |
5308 | 5307 |
5311 const _OrthancPluginSetMetricsIntegerValue& p = | 5310 const _OrthancPluginSetMetricsIntegerValue& p = |
5312 *reinterpret_cast<const _OrthancPluginSetMetricsIntegerValue*>(parameters); | 5311 *reinterpret_cast<const _OrthancPluginSetMetricsIntegerValue*>(parameters); |
5313 | 5312 |
5314 { | 5313 { |
5315 PImpl::ServerContextLock lock(*pimpl_); | 5314 PImpl::ServerContextLock lock(*pimpl_); |
5316 lock.GetContext().GetMetricsRegistry().SetValue(p.name, p.value, Plugins::Convert(p.type)); | 5315 lock.GetContext().GetMetricsRegistry().SetIntegerValue(p.name, p.value, Plugins::Convert(p.type)); |
5317 } | 5316 } |
5318 | 5317 |
5319 return true; | 5318 return true; |
5320 } | 5319 } |
5321 | 5320 |