# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
rust-version = "1.70"
name = "metrics-lib"
version = "0.9.5"
authors = ["James Gober <me@jamesgober.com>"]
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "High-performance Rust metrics library: sub-2ns counters, sub-1ns gauges, nanosecond timers, tumbling-window rate meters, async timing, adaptive sampling, and system health. Cross-platform with minimal dependencies."
homepage = "https://github.com/jamesgober/metrics-lib"
documentation = "https://docs.rs/metrics-lib"
readme = "README.md"
keywords = [
    "benchmark",
    "performance",
    "profiling",
    "timing",
    "metrics",
]
categories = [
    "development-tools::profiling",
    "memory-management",
]
license = "Apache-2.0"
repository = "https://github.com/jamesgober/metrics-lib"

[package.metadata.cargo-udeps.ignore]
normal = ["sysinfo"]

[features]
all = [
    "count",
    "gauge",
    "timer",
    "meter",
    "sample",
    "histogram",
]
async = ["dep:tokio"]
bench-tests = []
count = []
default = [
    "count",
    "gauge",
    "timer",
]
exporters-all = [
    "serde",
    "statsd",
    "otlp",
]
full = [
    "count",
    "gauge",
    "timer",
    "meter",
    "sample",
    "histogram",
    "async",
    "serde",
    "statsd",
    "otlp",
    "tracing",
]
gauge = []
histogram = ["sample"]
meter = []
minimal = ["count"]
otlp = ["serde"]
sample = []
serde = [
    "dep:serde",
    "dep:serde_json",
]
statsd = []
timer = []
tracing = ["dep:tracing"]

[lib]
name = "metrics_lib"
path = "src/lib.rs"

[[example]]
name = "async_batch_timing"
path = "examples/async_batch_timing.rs"
required-features = ["async"]

[[example]]
name = "axum_middleware_metrics"
path = "examples/axum_middleware_metrics.rs"
required-features = ["async"]

[[example]]
name = "axum_registry_integration"
path = "examples/axum_registry_integration.rs"
required-features = [
    "async",
    "meter",
]

[[example]]
name = "benchmark_comparison"
path = "examples/benchmark_comparison.rs"
required-features = ["meter"]

[[example]]
name = "broker_throughput"
path = "examples/broker_throughput.rs"
required-features = ["meter"]

[[example]]
name = "cache_hit_miss"
path = "examples/cache_hit_miss.rs"
required-features = [
    "count",
    "timer",
]

[[example]]
name = "contention_admission"
path = "examples/contention_admission.rs"
required-features = ["meter"]

[[example]]
name = "cpu_stats"
path = "examples/cpu_stats.rs"

[[example]]
name = "custom_exporter_openmetrics"
path = "examples/custom_exporter_openmetrics.rs"
required-features = ["meter"]

[[example]]
name = "health_dashboard"
path = "examples/health_dashboard.rs"
required-features = ["async"]

[[example]]
name = "histogram_latency"
path = "examples/histogram_latency.rs"
required-features = ["histogram"]

[[example]]
name = "labels_demo"
path = "examples/labels_demo.rs"
required-features = ["count"]

[[example]]
name = "memory_stats"
path = "examples/memory_stats.rs"

[[example]]
name = "otlp_push"
path = "examples/otlp_push.rs"
required-features = [
    "otlp",
    "count",
    "gauge",
    "timer",
    "histogram",
]

[[example]]
name = "prometheus_endpoint"
path = "examples/prometheus_endpoint.rs"
required-features = [
    "async",
    "count",
    "gauge",
    "timer",
    "histogram",
]

[[example]]
name = "quick_start"
path = "examples/quick_start.rs"
required-features = ["meter"]

[[example]]
name = "quick_tour"
path = "examples/quick_tour.rs"
required-features = ["meter"]

[[example]]
name = "snapshot_serde"
path = "examples/snapshot_serde.rs"
required-features = [
    "serde",
    "count",
    "gauge",
]

[[example]]
name = "statsd_push"
path = "examples/statsd_push.rs"
required-features = [
    "statsd",
    "count",
    "gauge",
    "timer",
]

[[example]]
name = "streaming_rate_window"
path = "examples/streaming_rate_window.rs"
required-features = [
    "async",
    "meter",
]

[[example]]
name = "token_bucket_limiter"
path = "examples/token_bucket_limiter.rs"
required-features = ["meter"]

[[test]]
name = "api_md_doctest"
path = "tests/api_md_doctest.rs"

[[test]]
name = "chaos_tests"
path = "tests/chaos_tests.rs"

[[test]]
name = "longevity_tests"
path = "tests/longevity_tests.rs"

[[test]]
name = "proptests"
path = "tests/proptests.rs"

[[bench]]
name = "metrics_bench"
path = "benches/metrics_bench.rs"
harness = false
required-features = ["meter"]

[dependencies.num_cpus]
version = "1.16"

[dependencies.parking_lot]
version = "0.12"

[dependencies.serde]
version = "1.0"
features = ["derive"]
optional = true

[dependencies.serde_json]
version = "1.0"
optional = true

[dependencies.sysinfo]
version = "0.29"
default-features = false

[dependencies.tokio]
version = "1.0"
features = [
    "rt",
    "time",
    "macros",
    "sync",
]
optional = true

[dependencies.tracing]
version = "0.1"
features = ["std"]
optional = true
default-features = false

[dev-dependencies.anyhow]
version = "1"

[dev-dependencies.axum]
version = "0.7"
features = [
    "http1",
    "json",
    "tokio",
]
default-features = false

[dev-dependencies.criterion]
version = "=0.4.0"
default-features = false

[dev-dependencies.crossbeam-channel]
version = "0.5"

[dev-dependencies.doc-comment]
version = "0.3"

[dev-dependencies.half]
version = "=2.2.1"

[dev-dependencies.proptest]
version = "=1.0.0"
features = ["std"]
default-features = false

[dev-dependencies.rand]
version = "0.8"

[dev-dependencies.serde_json]
version = "1.0"

[dev-dependencies.tokio]
version = "1.0"
features = ["full"]

[dev-dependencies.tokio-test]
version = "0.4"

[dev-dependencies.tower]
version = "0.5"
