From 1ef379af5e1b7bf3927de77ee79cc141eef14b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jan=20Niemier?= Date: Thu, 28 Nov 2024 17:35:19 +0100 Subject: [PATCH] feat: use microseconds for measuring pool checkouts (#493) Change time unit used for measures to microsecond so all measurements are multiplied by factor of `1000` which should give us better insights into real distribution. --- lib/supavisor/monitoring/tenant.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/supavisor/monitoring/tenant.ex b/lib/supavisor/monitoring/tenant.ex index d129b343..e7f5e586 100644 --- a/lib/supavisor/monitoring/tenant.ex +++ b/lib/supavisor/monitoring/tenant.ex @@ -37,23 +37,23 @@ defmodule Supavisor.PromEx.Plugins.Tenant do :supavisor_tenant_client_event_metrics, [ distribution( - [:supavisor, :pool, :checkout, :duration, :local], + [:supavisor, :pool, :checkout, :duration, :local, :us], event_name: [:supavisor, :pool, :checkout, :stop, :local], measurement: :duration, description: "Duration of the checkout local process in the tenant db pool.", tags: @tags, - unit: {:native, :millisecond}, + unit: {:native, :microsecond}, reporter_options: [ peep_bucket_calculator: Buckets ] ), distribution( - [:supavisor, :pool, :checkout, :duration, :remote], + [:supavisor, :pool, :checkout, :duration, :remote, :us], event_name: [:supavisor, :pool, :checkout, :stop, :remote], measurement: :duration, description: "Duration of the checkout remote process in the tenant db pool.", tags: @tags, - unit: {:native, :millisecond}, + unit: {:native, :microsecond}, reporter_options: [ peep_bucket_calculator: Buckets ]