{"id":31915478,"url":"https://github.com/stackify/stackify-metrics","last_synced_at":"2025-10-13T19:47:33.392Z","repository":{"id":18300554,"uuid":"21475772","full_name":"stackify/stackify-metrics","owner":"stackify","description":"Stackify Metric API for Java","archived":false,"fork":false,"pushed_at":"2022-10-05T02:52:20.000Z","size":88,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-07-06T17:50:09.765Z","etag":null,"topics":["java","metrics","stackify"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-03T20:19:36.000Z","updated_at":"2020-07-07T21:31:01.000Z","dependencies_parsed_at":"2023-01-11T20:20:54.997Z","dependency_job_id":null,"html_url":"https://github.com/stackify/stackify-metrics","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/stackify/stackify-metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackify%2Fstackify-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackify%2Fstackify-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackify%2Fstackify-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackify%2Fstackify-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackify","download_url":"https://codeload.github.com/stackify/stackify-metrics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackify%2Fstackify-metrics/sbom","scorecard":{"id":845423,"data":{"date":"2025-08-11","repo":{"name":"github.com/stackify/stackify-metrics","commit":"2c672deb0ee48fc4a6c79ba68f53bb5f571ce267"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"23 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-wf8f-6423-gfxg","Warn: Project is vulnerable to: GHSA-288c-cq4h-88gq","Warn: Project is vulnerable to: GHSA-57j2-w4cx-62h2","Warn: Project is vulnerable to: GHSA-5949-rw7g-wx7w","Warn: Project is vulnerable to: GHSA-5r5r-6hpj-8gg9","Warn: Project is vulnerable to: GHSA-89qr-369f-5m5x","Warn: Project is vulnerable to: GHSA-8c4j-34r4-xr8g","Warn: Project is vulnerable to: GHSA-8w26-6f25-cm9x","Warn: Project is vulnerable to: GHSA-9gph-22xh-8x98","Warn: Project is vulnerable to: GHSA-9m6f-7xcq-8vf8","Warn: Project is vulnerable to: GHSA-cvm9-fjm9-3572","Warn: Project is vulnerable to: GHSA-f9xh-2qgp-cq57","Warn: Project is vulnerable to: GHSA-h3cw-g4mq-c5x2","Warn: Project is vulnerable to: GHSA-jjjh-jjxp-wpff","Warn: Project is vulnerable to: GHSA-m6x4-97wx-4q27","Warn: Project is vulnerable to: GHSA-qjw2-hr98-qgfh","Warn: Project is vulnerable to: GHSA-r3gr-cxrf-hg25","Warn: Project is vulnerable to: GHSA-r695-7vr9-jgc2","Warn: Project is vulnerable to: GHSA-rgv9-q543-rqg4","Warn: Project is vulnerable to: GHSA-v585-23hc-c647","Warn: Project is vulnerable to: GHSA-vfqx-33qm-g869","Warn: Project is vulnerable to: GHSA-wh8g-3j2c-rqj5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T21:19:13.918Z","repository_id":18300554,"created_at":"2025-08-23T21:19:13.918Z","updated_at":"2025-08-23T21:19:13.918Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016839,"owners_count":26085889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","metrics","stackify"],"created_at":"2025-10-13T19:47:29.560Z","updated_at":"2025-10-13T19:47:33.383Z","avatar_url":"https://github.com/stackify.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stackify-metrics\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.stackify/stackify-metrics.svg)](http://mvnrepository.com/artifact/com.stackify/stackify-metrics)\n[![Build Status](https://travis-ci.org/stackify/stackify-metrics.png)](https://travis-ci.org/stackify/stackify-metrics)\n[![Coverage Status](https://coveralls.io/repos/stackify/stackify-metrics/badge.png?branch=master)](https://coveralls.io/r/stackify/stackify-metrics?branch=master)\n\nAPI for sending custom metrics to Stackify.\n\nCustom Metrics Overview:\n\nhttp://support.stackify.com/custom-metrics-overview/\n\nSign Up for a Trial:\n\nhttp://www.stackify.com/sign-up/\n\n## Installation\n\nAdd it as a maven dependency:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.stackify\u003c/groupId\u003e\n    \u003cartifactId\u003estackify-metrics\u003c/artifactId\u003e\n    \u003cversion\u003e2.1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\nThere are four different types of metrics: \n* Gauge: Keeps track of the last value that was set in the current minute\n* Counter: Calculates the rate per minute\n* Average: Calculates the average of all values in the current minute\n* Timer: Calculates the average elapsed time for an operation in the current minute\n* CounterAndTimer: Composite of the Counter and Timer metrics for convenience\n\nAll metrics are identified with a category and name. We will group metrics with the same category when they are displayed in Stackify. Use the MetricFactory to get different types of metrics. See below for more details on the operations available for each type of metric. \n```java\nGauge gauge = MetricFactory.getGauge(\"MyCategory\", \"MyGauge\");\n...\n```\n\nBe sure to properly shutdown to flush any queued metrics and shutdown the background thread:\n```java\nMetricManager.shutdown();\n```\n\n#### Configuration\n\nYou need a stackify-api.properties file on your classpath that defines the configuration required for the Metrics API:\n```\nstackify.apiKey=YOUR_API_KEY\nstackify.application=YOUR_APPLICATION_NAME\nstackify.environment=YOUR_ENVIRONMENT\n```\n\nNote: *If you are logging from a device that has the stackify-agent installed, the environment setting is optional. We will use the environment associated to your device in Stackify.*\n\n#### Programmatic Configuration (Optional)\n\nInstead of providing a properties file in your classpath, you can configure the Metrics API programmatically:\n```\nApiConfiguration.Builder builder = ApiConfiguration.newBuilder();\nbuilder.apiKey(\"YOUR_API_KEY\");\nbuilder.application(\"YOUR_APPLICATION_NAME\");\nbuilder.environment(\"YOUR_ENVIRONMENT\");\nApiConfiguration config = builder.build();\n\t\t\nMetricManager.configure(config);\n```\n\nThis needs to be done at application startup before any other interactions with the Metrics API.\n\nNote: *If you are logging from a device that has the stackify-agent installed, the environment setting is optional. We will use the environment associated to your device in Stackify.*\n\n#### Gauge Metric\n\n```java\n// Get a Gauge metric\nGauge gauge = MetricFactory.getGauge(\"MyCategory\", \"MyGauge\");\n...\n\n// Set the value of the metric to v\ngauge.set(v);\n...\n\n// Adds v to the current value of the metric\ngauge.add(v);\n...\n\n// Subtracts v from the current value of the metric\ngauge.subtract(v);\n...\n\n// Automatically report 0 for the value of the metric if not set\ngauge.autoReportZeroValue();\n...\n\n// Automatically report the last value for this metric if not set\ngauge.autoReportLastValue();\n...\n```\n\n#### Counter Metric\n\n```java\n// Get a Counter metric\nCounter counter = MetricFactory.getCounter(\"MyCategory\", \"MyCounter\");\n...\n\n// Adds 1 to the current value of the metric\ncounter.increment();\n...\n\n// Adds v to the current value of the metric\ncounter.increment(v);\n...\n\n// Subtracts 1 from the current value of the metric\ncounter.decrement();\n...\n\n// Subtracts v from the current value of the metric\ncounter.decrement(v);\n...\n\n// Adds v to the current value of the metric\ncounter.add(v);\n...\n\n// Subtracts v from the current value of the metric\ncounter.subtract(v);\n...\n\n// Automatically report 0 for the value of the metric if not set\ncounter.autoReportZeroValue();\n...\n```\n\n#### Average Metric\n\n```java\n// Get a Average metric\nAverage average = MetricFactory.getAverage(\"MyCategory\", \"MyAverage\");\n...\n\n// Adds a value to the average metric\naverage.addValue(v);\n...\n\n// Automatically report 0 for the value of the metric if not set\naverage.autoReportZeroValue();\n...\n\n// Automatically report the last value for this metric if not set\naverage.autoReportLastValue();\n...\n```\n\n#### Timer Metric\n\n```java\n// Get a Timer metric\nTimer timer = MetricFactory.getTimer(\"MyCategory\", \"MyTimer\");\n...\n\n// Calculates the time taken for this operation using the start time d (java.util.Date)\ntimer.start(d);\n...\n\n// Calculates the time taken for this operation using the start time d (milliseconds)\ntimer.startMs(d);\n...\n\n// Sets the time taken for this operation to d (milliseconds)\ntimer.durationMs(d);\n...\n\n// Automatically report 0 for the value of the metric if not set\ntimer.autoReportZeroValue();\n...\n```\n\n#### CounterAndTimer Metric\n\n```java\n// Get a CounterAndTimer metric (composite of a Counter metric and Timer metric)\nCounterAndTimer counterAndTimer = MetricFactory.getCounterAndTimer(\"MyCategory\", \"MyCounterAndTimer\");\n...\n\n// Counter: Adds 1 to the current value of the metric\n// Timer: Calculates the time taken for this operation using the start time d (java.util.Date)\ncounterAndTimer.start(d);\n...\n\n// Counter: Adds 1 to the current value of the metric\n// Timer: Calculates the time taken for this operation using the start time d (milliseconds)\ncounterAndTimer.startMs(d);\n...\n\n// Counter: Adds 1 to the current value of the metric\n// Timer: Sets the time taken for this operation to d (milliseconds)\ncounterAndTimer.durationMs(d);\n...\n\n// Automatically report 0 for the value of the metric if not set\ncounterAndTimer.autoReportZeroValue();\n...\n```\n\n## License\n\nCopyright 2020 Stackify, LLC.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackify%2Fstackify-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackify%2Fstackify-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackify%2Fstackify-metrics/lists"}