XQBase Metric Common

a lightweight metric framework for aggregating, collecting and showing metric data - common part

License

License

GroupId

GroupId

com.xqbase
ArtifactId

ArtifactId

xqbase-metric-common-jdk17
Last Version

Last Version

0.2.13
Release Date

Release Date

Type

Type

jar
Description

Description

XQBase Metric Common
a lightweight metric framework for aggregating, collecting and showing metric data - common part
Project URL

Project URL

https://github.com/xqbase/metric
Source Code Management

Source Code Management

https://github.com/xqbase/metric.git

Download xqbase-metric-common-jdk17

How to add to project

<!-- https://jarcasting.com/artifacts/com.xqbase/xqbase-metric-common-jdk17/ -->
<dependency>
    <groupId>com.xqbase</groupId>
    <artifactId>xqbase-metric-common-jdk17</artifactId>
    <version>0.2.13</version>
</dependency>
// https://jarcasting.com/artifacts/com.xqbase/xqbase-metric-common-jdk17/
implementation 'com.xqbase:xqbase-metric-common-jdk17:0.2.13'
// https://jarcasting.com/artifacts/com.xqbase/xqbase-metric-common-jdk17/
implementation ("com.xqbase:xqbase-metric-common-jdk17:0.2.13")
'com.xqbase:xqbase-metric-common-jdk17:jar:0.2.13'
<dependency org="com.xqbase" name="xqbase-metric-common-jdk17" rev="0.2.13">
  <artifact name="xqbase-metric-common-jdk17" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.xqbase', module='xqbase-metric-common-jdk17', version='0.2.13')
)
libraryDependencies += "com.xqbase" % "xqbase-metric-common-jdk17" % "0.2.13"
[com.xqbase/xqbase-metric-common-jdk17 "0.2.13"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

XQBase Metric

A lightweight metric framework for aggregating, collecting and showing metric data.

For basic concepts of metric, see Metric and Dashboard in SlideShare, or download here.

How to use Metric in server codes?

Import the metric-client library as a maven dependency:

<dependency>
	<groupId>com.xqbase</groupId>
	<artifactId>xqbase-metric-client</artifactId>
	<version>0.2.5</version>
</dependency>

For a webapp project, add a filter into web.xml:

<filter>
	<filter-name>MetricFilter</filter-name>
	<filter-class>com.xqbase.metric.client.MetricFilter</filter-class>
	<init-param>
		<param-name>addresses</param-name>
		<param-value>${metric.collectors}</param-value>
	</init-param>
	<init-param>
		<param-name>prefix</param-name>
		<param-value>${metric.prefix}</param-value>
	</init-param>
</filter>
<filter-mapping>
	<filter-name>MetricFilter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

For a standalone application, use the following codes:

// Start aggregating metrics
MetricClient.startup(collectors);
...
// Log an event
Metric.put(metricName, metricValue, tagName1, tagValue1, tagName2, tagValue2, ...);
...
// Stop aggregating metrics
MetricClient.shutdown();

How to deploy a Metric server?

  • Install MongoDB
  • Deploy Metric Collector
  • Deploy and Configure Dashboard
com.xqbase

Versions

Version
0.2.13
0.2.10
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0