Skip to content

Commit

Permalink
Add the max_connections metric (#12689)
Browse files Browse the repository at this point in the history
* Add the `max_connections` metric

* Assert metrics using metadata

* Revert "Assert metrics using metadata"

This reverts commit 2c38338.

* Validate metadata
  • Loading branch information
FlorentClarret authored Aug 15, 2022
1 parent 9fdaf39 commit 9dc0514
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions mcache/datadog_checks/mcache/mcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Memcache(AgentCheck):
"uptime",
"bytes",
"curr_connections",
"max_connections",
"connection_structures",
"threads",
"pointer_size",
Expand Down
1 change: 1 addition & 0 deletions mcache/metadata.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ memcache.cmd_get_rate,gauge,,command,second,"Rate of ""get"" commands.",0,memcac
memcache.cmd_set_rate,gauge,,command,second,"Rate of ""set"" commands.",0,memcached,cmd set rate,
memcache.connection_structures,gauge,,,,Number of connection structures allocated by the server.,0,memcached,conn structs,
memcache.curr_connections,gauge,,connection,,Number of open connections to this server.,0,memcached,curr conns,
memcache.max_connections,gauge,,connection,,Maximum number of connections to this server.,0,memcached,max conns,
memcache.curr_items,gauge,,item,,Current number of items stored by the server.,0,memcached,curr items,
memcache.delete_hits_rate,gauge,,hit,second,Rate at which delete commands result in items being removed.,0,memcached,del hit rate,
memcache.delete_misses_rate,gauge,,miss,second,Rate at which delete commands result in no items being removed.,0,memcached,del miss rate,
Expand Down
1 change: 1 addition & 0 deletions mcache/tests/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"memcache.uptime",
"memcache.bytes",
"memcache.curr_connections",
"memcache.max_connections",
"memcache.connection_structures",
"memcache.threads",
"memcache.pointer_size",
Expand Down
3 changes: 3 additions & 0 deletions mcache/tests/test_integration_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest

from datadog_checks.dev.utils import get_metadata_metrics
from datadog_checks.mcache import Memcache

from .common import HOST, PORT, SERVICE_CHECK, requires_socket_support, requires_unix_utils
Expand Down Expand Up @@ -39,6 +40,7 @@ def test_e2e(client, dd_agent_check, instance):
aggregator = dd_agent_check(instance, rate=True)

assert_check_coverage(aggregator)
aggregator.assert_metrics_using_metadata(get_metadata_metrics())


@pytest.mark.integration
Expand Down Expand Up @@ -72,6 +74,7 @@ def test_metrics(client, instance, aggregator, dd_run_check):
dd_run_check(check)

assert_check_coverage(aggregator)
aggregator.assert_metrics_using_metadata(get_metadata_metrics(), check_submission_type=True)


@pytest.mark.integration
Expand Down

0 comments on commit 9dc0514

Please sign in to comment.