SYNAXON / GraphiteReceiver

A vmware statsfeeder receiver to export the stats directly into graphite.
Apache License 2.0
20 stars 7 forks source link

Config to get only 1 metric / minute ? how to modify GraphiteReceiver tree scheme ? #4

Closed toni-moreno closed 8 years ago

toni-moreno commented 9 years ago

Hi I'm testing this promising tool and would like to get only 1 metric/min

but I'm receiving metrics for each 20 seconds.

esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 9976 1426238040
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 9863 1426238060
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 9991 1426238080
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 10007 1426238100
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 9984 1426238120
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 9866 1426238140
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 9991 1426238160
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 9987 1426238180
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 9844 1426238200
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 10013 1426238220
esxtest.myserver00_domain_subdomain_es.cpu.idle.summation_millisecond 9917 1426238240

with this config

...
<numberOfThreads>10</numberOfThreads>
<frequency unit="second">60</frequency>
<feeder>true</feeder>
 <receivers>
        <receiver>
            <name>graphite</name>
            <class>de.synaxon.graphitereceiver.MetricsReceiver</class>
            <properties>
                <!--  Set the file name. Files will be rolled over on the hour -->
                <property>
                    <name>host</name>
                    <value>localhost</value>
                </property>
                <property>
                    <name>port</name>
                    <value>2055</value>
                </property>
                <property>
                    <name>prefix</name>
                    <value>esxtest</value>
                </property>
            </properties>
        </receiver>
 </receivers>
...
...

I'm also getting "myserver00_domain_subdomain_es" and i would like to get only "myserver00".

I would like also modify this GraphiteReceiver to get this tree scheme.

<prefix>.<cluster>.<object_type>.<object_name>.<counter_group>.<instance_name>.<counter_name>-<rollup>

where

object_type could be "vm" "esx" ( as vmstats does) counter_group are groups defined in http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.PerformanceManager.html

In order to do a PR I'm trying to understand what are you doing here

https://github.com/SYNAXON/GraphiteReceiver/blob/master/src/main/java/de/synaxon/graphitereceiver/MetricsReceiver.java#L103-L126

But I need information about "PerfMetricSet metricSet" object API.

where can I look for?

kofrezo commented 9 years ago

That's a really good question - I did not find any api docs on the net via google. I guess you need to kind of reverse engineer it. Setup a development environment and inspect classes via autocompletion of IDE and the java docs.

Seems like there is no official documentation since its a product of vmware labs checkout:

com.vmware.ee.statsfeeder.ExecutionContext

toni-moreno commented 9 years ago

I'm working on a PR to summarize all data depending on the rollup type. I'll do some more test and after I will push a PR.

https://github.com/toni-moreno/GraphiteReceiver/tree/num_samples_improvements