# class Prometheus::Summary

- Prometheus::Summary
- Prometheus::Metric
- Reference
- Object

##
Overview

A Summary captures individual observations from an event or sample stream and summarizes them with count and sum.

Use a Summary for metrics where you need the count and sum, such as:

- Request latencies
- Request sizes
- Response sizes

Example:

    summary = Summary.new("request_size", "Request size in bytes")
    summary.observe(1024)

Summaries track:

- Count of all observed values
- Sum of all observed values

##
Defined in:

metrics.cr

##
Constructors

- .new(name : String, help : String, labels = LabelSet.new)

##
Instance Method Summary

- #collect : Array(Sample)
- #observe(value : Number)
- #type : String

### Instance methods inherited from class `Prometheus::Metric`

collect : Array(Sample) collect, help : String help, labels : LabelSet labels, name : String name, type : String type

### Constructor methods inherited from class `Prometheus::Metric`

new(name : String, help : String, labels : Prometheus::LabelSet = LabelSet.new) new

##
Constructor Detail

def self.new(name : String, help : String, labels = LabelSet.new) #

##
Instance Method Detail

def collect : Array(Sample) #
def observe(value : Number) #
def type : String #