core

Realtime Analytics

License

License

Categories

Categories

Metrics Application Testing & Monitoring Monitoring
GroupId

GroupId

com.ning
ArtifactId

ArtifactId

metrics.realtime-core
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

core
Realtime Analytics
Project Organization

Project Organization

Ning, Inc.

Download metrics.realtime-core

How to add to project

<!-- https://jarcasting.com/artifacts/com.ning/metrics.realtime-core/ -->
<dependency>
    <groupId>com.ning</groupId>
    <artifactId>metrics.realtime-core</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.ning/metrics.realtime-core/
implementation 'com.ning:metrics.realtime-core:1.1.0'
// https://jarcasting.com/artifacts/com.ning/metrics.realtime-core/
implementation ("com.ning:metrics.realtime-core:1.1.0")
'com.ning:metrics.realtime-core:jar:1.1.0'
<dependency org="com.ning" name="metrics.realtime-core" rev="1.1.0">
  <artifact name="metrics.realtime-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.ning', module='metrics.realtime-core', version='1.1.0')
)
libraryDependencies += "com.ning" % "metrics.realtime-core" % "1.1.0"
[com.ning/metrics.realtime-core "1.1.0"]

Dependencies

compile (30)

Group / Artifact Type Version
com.espertech : esper jar 4.2.0
com.google.guava : guava jar 11.0.1
com.google.inject : guice jar 3.0
com.google.inject.extensions : guice-servlet jar 3.0
com.ning : async-http-client jar 1.6.5
com.sun.jersey.contribs : jersey-guice jar 1.10
com.sun.jersey : jersey-core jar 1.10
com.yammer.metrics : metrics-core jar 2.0.0-BETA18
commons-lang : commons-lang jar 2.6
javax.mail : mail jar 1.4.5-rc1
javax.inject : javax.inject jar 1
javax.servlet : javax.servlet-api jar 3.0.1
joda-time : joda-time jar 2.0
log4j : log4j jar 1.2.16
org.apache.activemq : activemq-core jar 5.5.1
org.apache.commons : commons-email jar 1.2
org.apache.commons : commons-io jar 1.3.2
org.apache.geronimo.specs : geronimo-jms_1.1_spec jar 1.1.1
org.codehaus.jackson : jackson-core-asl jar 1.9.4
org.codehaus.jackson : jackson-jaxrs jar 1.9.4
org.codehaus.jackson : jackson-mapper-asl jar 1.9.4
org.eclipse.jetty : jetty-jmx jar 8.0.4.v20111024
org.eclipse.jetty : jetty-server jar 8.0.4.v20111024
org.eclipse.jetty : jetty-servlet jar 8.0.4.v20111024
org.eclipse.jetty : jetty-util jar 8.0.4.v20111024
org.skife.config : config-magic jar 0.13
org.slf4j : slf4j-api jar 1.6.4
org.slf4j : jul-to-slf4j jar 1.6.4
net.sf.json-lib : json-lib jar 2.4
xom : xom jar 1.1

runtime (1)

Group / Artifact Type Version
org.slf4j : slf4j-log4j12 jar 1.6.4

test (1)

Group / Artifact Type Version
org.testng : testng jar 6.3

Project Modules

There are no modules declared in this project.

Meteo

Meteo is a realtime event processing engine. It can get time series data from a variety of sources and leverages Esper to do runtime analysis. Meteo can output data to different rendering engines for graphing purposes.

Build Status

Listeners

Meteo can currently take data from:

  • Flat files

  • Netezza

  • ActiveMQ

  • JMX

Publishers

Meteo can currently publish data to:

  • Flat files

  • Arecibo

  • Graphite

  • OpenTSDB

  • Reconnoiter (via Resmon)

Build

mvn clean install

Run

java -Drt.configFile=rt_conf.json -Drt.esper.configFile=esper_conf.xml -Xmx4096m -Xms2048m -jar metrics.mateo-1.0.1-jar-with-dependencies.jar

Configuration

Publisher and listeners

This configuration file contains sample configurations for all currently defined publisher and subscriber types plus sample Esper statements:

{
    "subscribers": [
        {
            "name": "AMQ",
            "type": "com.ning.metrics.meteo.subscribers.AMQSubscriber",
            "@class": "com.ning.metrics.meteo.subscribers.AMQSubscriberConfig",
            "protocol": "tcp",
            "host": "127.0.0.1",
            "port": 35000,
            "topic": "PerfEvent",
            "eventOutputName": "PerfEvent",
            "enabled": false
        },
        {
            "name": "AMQ2",
            "type": "com.ning.metrics.meteo.subscribers.AMQSubscriber",
            "@class": "com.ning.metrics.meteo.subscribers.AMQSubscriberConfig",
            "protocol": "tcp",
            "host": "127.0.0.1",
            "port": 35000,
            "topic": "MyOtherTopic",
            "eventOutputName": "MyOtherTopic",
            "enabled": false
        },
        {
            "name": "JMX",
            "type": "com.ning.metrics.meteo.subscribers.JMXSubscriber",
            "@class": "com.ning.metrics.meteo.subscribers.JMXSubscriberConfig",
            "host": "127.0.0.1",
            "query": "java.lang:type=OperatingSystem",
            "attributes": "SystemLoadAverage",
            "eventOutputName": "LoadAverage",
            "enabled": false
        },
        {
            "name": "Netezza",
            "type": "com.ning.metrics.meteo.subscribers.NetezzaSubscriber",
            "@class": "com.ning.metrics.meteo.subscribers.NetezzaSubscriberConfig",
            "sqlQuery": "select html_time from visit_logs order by visit_date asc",
            "host": "netezza.company.com",
            "username": "pierre",
            "password": "pierre",
            "database": "visit",
            "eventOutputName": "visit",
            "enabled": false
        },
        {
            "name": "File",
            "type": "com.ning.metrics.meteo.subscribers.FileSubscriber",
            "@class": "com.ning.metrics.meteo.subscribers.FileSubscriberConfig",
            "filePath": "/var/tmp/someFile.csv",
            "attributes": "SystemLoadAverage",
            "eventOutputName": "LoadAverage",
            "enabled": false
        }
    ],

    "publishers": [
        {
            "name": "Debug",
            "type": "com.ning.metrics.meteo.publishers.DebugListener",
            "@class": "com.ning.metrics.meteo.publishers.DebugPublisherConfig"
        },
        {
            "name": "File",
            "type": "com.ning.metrics.meteo.publishers.FileListener",
            "@class": "com.ning.metrics.meteo.publishers.FilePublisherConfig",
            "path": "/var/tmp/demo.csv"
        },
        {
            "name": "Resmon",
            "type": "com.ning.metrics.meteo.publishers.ResmonListener",
            "@class": "com.ning.metrics.meteo.publishers.ResmonPublisherConfig",
            "host": "127.0.0.1",
            "port": 8083
        },
        {
            "name": "Graphite",
            "type": "com.ning.metrics.meteo.publishers.GraphiteListener",
            "@class": "com.ning.metrics.meteo.publishers.GraphitePublisherConfig",
            "host": "127.0.0.1",
            "port": 2003
        },
        {
            "name": "Arecibo",
            "type": "com.ning.metrics.meteo.publishers.AreciboListener",
            "@class": "com.ning.metrics.meteo.publishers.AreciboPublisherConfig",
            "host": "127.0.0.1",
            "port": 8080
        },
        {
            "name": "OpenTSDB",
            "type": "com.ning.metrics.meteo.publishers.OpenTSDBListener",
            "@class": "com.ning.metrics.meteo.publishers.OpenTSDBPublisherConfig",
            "host": "127.0.0.1",
            "port": 4242
        }
    ],

    "streams": [
        {
            "name": "Performance metrics",

            "sql": [
                "insert into RawPerfStream select html_time from PerfEvent",
                "insert into HWPerfStream select lastRaw as raw, forecast, deviation, smoothedDeviation from RawPerfStream.ning:predict(html_time, 0.3, 0.1)",
                "select raw, forecast from HWPerfStream",
                "select forecast + 2.5 * avg(deviation) as upper_band, forecast - 2.5 * avg(deviation) as lower_band from HWPerfStream.win:time(12 sec)"
            ],

            "routes": [
                {
                    "name": "OpenTSDB",
                    "filters": [ "raw", "forecast", "deviation", "upper_band", "lower_band" ],
                    "prefix": "Perf.html_render_time"
                }
            ]
        }
    ]
}

Esper

All events that esper should process, need to be declared in the esper configuration file beforehand. A sample configuration file looks like this:

<esper-configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:noNamespaceSchemaLocation="esper-configuration-1-0.xsd">
    <event-type name="PerfEvent">
        <java-util-map>
            <map-property name="html_time" class="long"/>
        </java-util-map>
    </event-type>
    <event-type name="LoadAverage">
        <java-util-map>
            <map-property name="timestamp" class="long"/>
            <map-property name="SystemLoadAverage" class="long"/>
        </java-util-map>
    </event-type>
    <plugin-aggregation-function name="tp" function-class="com.ning.metrics.meteo.esper.TPAggregator"/>
    <plugin-view namespace="ning" name="predict"
                 factory-class="com.ning.metrics.meteo.esper.HoltWintersViewFactory"/>
</esper-configuration>

For more info see esper.codehaus.org/esper-4.2.0/doc/reference/en/html/configuration.html#configuration-via-xml

Adding routes at runtime

There is a REST interface one can use to upload streams at runtime. For instance, if newStream.json is:

{
    "name": "Counts",

    "sql": [
        "select count(*) as count from Visit.win:time(1 sec) "
    ],

    "routes": [
        {
            "name": "Jansky",
            "filters": [ "count" ]
        }
    ]
}

One can add it at runtime by POSTing it to /rest/1.0:

curl -v -XPOST http://127.0.0.1:8080/rest/1.0 -H'Content-type: application/json' [email protected]

Exposing data over HTTP

Meteo ships with a special publisher (com.ning.metrics.meteo.publishers.ResourceListener) to expose data over HTTP (jsonp). This is useful for graphing purposes (see github.com/pierre/metrics-dashboard for an example on how to use it with d3.js).

To use it, you need to add it as a publisher and configure a stream appropriately:

"publishers": [
    {
        "name": "Jansky",
        "type": "com.ning.metrics.meteo.publishers.ResourceListener",
        "@class": "com.ning.metrics.meteo.publishers.ResourcePublisherConfig"
    }
],

"streams": [
    {
        "name": "Visitors",

        "sql": [
            "select sourceIpAddress as ip from Visit.win:time(1 sec)"
        ],

        "routes": [
            {
                "name": "Jansky",
                "filters": [ "ip" ]
            }
        ]
    }
]

You can now access the data via the /rest/1.0/{stream_name}/{esper_attribute} endpoint, e.g.:

curl http://127.0.0.1:8080/rest/1.0/Visitors/ip ; echo

License (see LICENSE-2.0.txt file for full license)

Copyright 2010-2013 Ning

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Versions

Version
1.1.0