Sha256: c10b16222eabd6fa356f884d42895674a5228c8e66db132d7ce4a51444f0ef71

Contents?: true

Size: 544 Bytes

Versions: 4

Compression:

Stored size: 544 Bytes

Contents

require "spec_helper"

describe GitLab::Monitor::PrometheusMetrics do
  it "supports simple metrics" do
    expect(subject.add("mymetric", 1.1).to_s).to match(/mymetric 1.1 \d*$/)
  end

  it "supports metrics with one label" do
    expect(subject.add("mymetric", 1.2, mylabel: "x").to_s).to match(/mymetric{mylabel="x"} 1.2 \d*$/)
  end

  it "supports metrics with many labels" do
    expect(subject.add("mymetric", 1.3, mylabel: "x", myotherlabel: "y").to_s).to match(
      /mymetric{mylabel="x",myotherlabel="y"} 1.3 \d*$/
    )
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gitlab-monitor-4.2.0 spec/prometheus_metrics_spec.rb
gitlab-monitor-4.1.0 spec/prometheus_metrics_spec.rb
gitlab-monitor-4.0.1 spec/prometheus_metrics_spec.rb
gitlab-monitor-4.0.0 spec/prometheus_metrics_spec.rb