lib/bm/instrumentations/sequel/metrics_collection.rb
def record_query(db:, query:, stopwatch:, status: 'success')
          labels = {
            database: db || NONE,
            query: query || NONE,
            status: status
          }

          queries_total.increment(labels: labels)
          query_duration_seconds.observe(stopwatch.to_f, labels: labels)
        end
# Record metrics for a database query
#
# @param db [String, nil]
# @param query [String, nil]
# @param stopwatch [Instrumentations::Stopwatch] is a started timer
# @param status ['success', 'failure']
Record metrics for a database query
Record metrics for a database query
def record_query(db:, query:, stopwatch:, status: 'success')
          labels = {
            database: db || NONE,
            query: query || NONE,
            status: status
          }
          queries_total.increment(labels: labels)
          query_duration_seconds.observe(stopwatch.to_f, labels: labels)
        end
def record_query ( db : , query : , stopwatch : , status : 'success' ) labels = { database : db || NONE , query : query || NONE , status : status } queries_total . increment ( labels : labels ) query_duration_seconds . observe ( stopwatch . to_f , labels : labels ) end
Record metrics for a database query
Record metrics for a database query
db
query
stopwatch
None
status
None