Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metric creation is unclear. #23

Open
GrandLTU opened this issue Mar 19, 2015 · 0 comments
Open

Metric creation is unclear. #23

GrandLTU opened this issue Mar 19, 2015 · 0 comments

Comments

@GrandLTU
Copy link

After trying to create metric i get Metric with name 'date_metric' was not found.

Here is my class.

namespace ONGR\DemoBundle\Metrics;

use ONGR\MonitoringBundle\Metric\MetricInterface;

/**
 * Class DateMetric.
 */
class DateMetric implements MetricInterface
{
    /**
     * {@inheritdoc}
     */
    public function getValue()
    {
        return new \DateTime();
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'date_metric';
    }
}

This is my configs.

ongr_monitoring:
    es_manager: monitoring
    commands:
        commands:
            - ongr:monitoring:metrics:collect
    metric_collector:
        metrics:
            document_count:
                - { name: foo, document: es.manager.default.product }
            date_metric:
                - { name: date_metric, document: es.manager.default.product }

services:
    ongr_demo.metric.date:
        class: ONGR\DemoBundle\Metrics\DateMetric
        tags:
            - { name: ongr_monitoring.metric, metric: date_metric }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant