Skip to content

Commit

Permalink
Fix incorrect initialization of shared_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
yinggeh committed Oct 17, 2024
1 parent da632d1 commit 7f0612c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/infer_response.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ InferenceResponse::InferenceResponse(
response_fn_(response_fn), response_userp_(response_userp),
response_delegator_(delegator),
#ifdef TRITON_ENABLE_METRICS
responses_sent_(responses_sent), infer_start_ns_(infer_start_ns),
responses_sent_(std::move(responses_sent)),
infer_start_ns_(infer_start_ns),
#endif // TRITON_ENABLE_METRICS
null_response_(false)
{
Expand Down
4 changes: 2 additions & 2 deletions src/infer_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class InferenceResponseFactory {
is_cancelled_(false)
#ifdef TRITON_ENABLE_METRICS
,
responses_sent_(0)
responses_sent_(std::make_shared<std::atomic<uint64_t>>(0))
#endif // TRITON_ENABLE_METRICS
#ifdef TRITON_ENABLE_STATS
,
Expand Down Expand Up @@ -387,7 +387,7 @@ class InferenceResponse {

#ifdef TRITON_ENABLE_METRICS
// Total number of responses sent created by its response factory.
std::shared_ptr<std::atomic<uint64_t>> responses_sent_;
const std::shared_ptr<std::atomic<uint64_t>> responses_sent_;

// The start time of associate request in ns.
const uint64_t infer_start_ns_;
Expand Down
4 changes: 3 additions & 1 deletion src/metric_model_reporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ struct MetricReporterConfig {
bool latency_histograms_enabled_ = true;
// Create and use Summaries for per-model latency related metrics
bool latency_summaries_enabled_ = false;
// Buckets used for any histogram metrics. Each value represents
// a bucket boundary.
prometheus::Histogram::BucketBoundaries buckets_ = {100, 500, 2000, 5000};
// Quantiles used for any summary metrics. Each pair of values represents
// { quantile, error }. For example, {0.90, 0.01} means to compute the
// 90th percentile with 1% error on either side, so the approximate 90th
// percentile value will be between the 89th and 91st percentiles.
prometheus::Histogram::BucketBoundaries buckets_ = {10, 100, 500, 1000};
prometheus::Summary::Quantiles quantiles_ = {
{0.5, 0.05}, {0.9, 0.01}, {0.95, 0.001}, {0.99, 0.001}, {0.999, 0.001}};

Expand Down

0 comments on commit 7f0612c

Please sign in to comment.