Examples of MetricMeta


Examples of com.newrelic.plugins.mysql.MetricMeta

        Iterator<String> iter = results.keySet().iterator();
        while (iter.hasNext()) { // Iterate over current metrics
            String key = iter.next().toLowerCase();
            Float val = results.get(key);
            MetricMeta md = getMetricMeta(key);
            if (md != null) { // Metric Meta data exists (from metric.category.json)
                logger.debug(METRIC_LOG_PREFIX, key, SPACE, md, EQUALS, val);
                count++;

                if (md.isCounter()) { // Metric is a counter
                    reportMetric(key, md.getUnit(), md.getCounter().process(val));
                } else { // Metric is a fixed Number
                    reportMetric(key, md.getUnit(), val);
                }
            } else { // md != null
                if (firstReport) { // Provide some feedback of available metrics for future reporting
                    logger.debug("Not reporting identified metric ", key);
                }
View Full Code Here

Examples of com.newrelic.plugins.mysql.MetricMeta

            Map<String, String> attributes = (Map<String, String>) categories.get(category);
            String valueMetrics = attributes.get("value_metrics");
            if (valueMetrics != null) {
                Set<String> metrics = new HashSet<String>(Arrays.asList(valueMetrics.toLowerCase().replaceAll(SPACE, EMPTY_STRING).split(COMMA)));
                for (String s : metrics) {
                    addMetricMeta(category + SEPARATOR + s, new MetricMeta(false));
                }

            }
            String counterMetrics = attributes.get("counter_metrics");
            if (counterMetrics != null) {
                Set<String> metrics = new HashSet<String>(Arrays.asList(counterMetrics.toLowerCase().replaceAll(SPACE, EMPTY_STRING).split(COMMA)));
                for (String s : metrics) {
                    addMetricMeta(category + SEPARATOR + s, new MetricMeta(true));
                }
            }
        }

        /* Define New Relic specific metrics used for default dashboards */
        addMetricMeta("newrelic/volume_reads", new MetricMeta(true, "Queries/Second"));
        addMetricMeta("newrelic/volume_writes", new MetricMeta(true, "Queries/Second"));

        addMetricMeta("newrelic/bytes_reads", new MetricMeta(true, "Bytes/Second"));
        addMetricMeta("newrelic/bytes_writes", new MetricMeta(true, "Bytes/Second"));

        addMetricMeta("newrelic/connections_connected", new MetricMeta(false, "Connections"));
        addMetricMeta("newrelic/connections_running", new MetricMeta(false, "Connections"));
        addMetricMeta("newrelic/connections_cached", new MetricMeta(false, "Connections"));

        addMetricMeta("newrelic/innodb_bp_pages_created", new MetricMeta(true, "Pages/Second"));
        addMetricMeta("newrelic/innodb_bp_pages_read", new MetricMeta(true, "Pages/Second"));
        addMetricMeta("newrelic/innodb_bp_pages_written", new MetricMeta(true, "Pages/Second"));

        addMetricMeta("newrelic/query_cache_hits", new MetricMeta(true, "Queries/Seconds"));
        addMetricMeta("newrelic/query_cache_misses", new MetricMeta(true, "Queries/Seconds"));
        addMetricMeta("newrelic/query_cache_not_cached", new MetricMeta(true, "Queries/Seconds"));

        addMetricMeta("newrelic/replication_lag", new MetricMeta(false, "Seconds"));
        addMetricMeta("newrelic/replication_status", new MetricMeta(false, "State"));

        addMetricMeta("newrelic/pct_connection_utilization", new MetricMeta(false, "Percent"));
        addMetricMeta("newrelic/pct_innodb_buffer_pool_hit_ratio", new MetricMeta(false, "Percent"));
        addMetricMeta("newrelic/pct_query_cache_hit_utilization", new MetricMeta(false, "Percent"));
        addMetricMeta("newrelic/pct_query_cache_memory_in_use", new MetricMeta(false, "Percent"));
        addMetricMeta("newrelic/pct_tmp_tables_written_to_disk", new MetricMeta(false, "Percent"));

        addMetricMeta("newrelic/innodb_fsyncs_data", new MetricMeta(true, "Fsyncs/Second"));
        addMetricMeta("newrelic/innodb_fsyncs_os_log", new MetricMeta(true, "Fsyncs/Second"));

        addMetricMeta("newrelic/slave_relay_log_bytes", new MetricMeta(true, "Bytes/Second"));
        addMetricMeta("newrelic/master_log_lag_bytes", new MetricMeta(true, "Bytes/Second"));

        /* Define improved metric values for certain general metrics */
        addMetricMeta("status/aborted_clients", new MetricMeta(true, "Connections/Second"));
        addMetricMeta("status/aborted_connects", new MetricMeta(true, "Connections/Second"));

        addMetricMeta("status/bytes_sent", new MetricMeta(true, "Bytes/Second"));
        addMetricMeta("status/bytes_received", new MetricMeta(true, "Bytes/Second"));

        addMetricMeta("status/com_select", new MetricMeta(true, "Selects/Second"));
        addMetricMeta("status/com_insert", new MetricMeta(true, "Inserts/Second"));
        addMetricMeta("status/com_insert_select", new MetricMeta(true, "Inserts/Second"));
        addMetricMeta("status/com_update", new MetricMeta(true, "Updates/Second"));
        addMetricMeta("status/com_update_multi", new MetricMeta(true, "Updates/Second"));
        addMetricMeta("status/com_delete", new MetricMeta(true, "Deletes/Second"));
        addMetricMeta("status/com_delete_multi", new MetricMeta(true, "Deletes/Second"));
        addMetricMeta("status/com_replace", new MetricMeta(true, "Replaces/Second"));
        addMetricMeta("status/com_replace_select", new MetricMeta(true, "Replaces/Second"));

        addMetricMeta("status/slow_queries", new MetricMeta(true, "Queries/Second"));
        addMetricMeta("status/created_tmp_tables", new MetricMeta(true, "Queries/Second"));
        addMetricMeta("status/created_tmp_disk_tables", new MetricMeta(true, "Queries/Second"));

        addMetricMeta("status/innodb_buffer_pool_pages_flushed", new MetricMeta(true, "Pages/Second"));

        addMetricMeta("newrelic/innodb_buffer_pool_pages_clean", new MetricMeta(false, "Pages"));
        addMetricMeta("newrelic/innodb_buffer_pool_pages_dirty", new MetricMeta(false, "Pages"));
        addMetricMeta("newrelic/innodb_buffer_pool_pages_misc", new MetricMeta(false, "Pages"));
        addMetricMeta("newrelic/innodb_buffer_pool_pages_free", new MetricMeta(false, "Pages"));
        addMetricMeta("newrelic/innodb_buffer_pool_pages_unassigned", new MetricMeta(false, "Pages"));

        addMetricMeta("status/innodb_data_fsyncs", new MetricMeta(true, "Fsyncs/Second"));
        addMetricMeta("status/innodb_os_log_fsyncs", new MetricMeta(true, "Fsyncs/Second"));

        addMetricMeta("status/innodb_os_log_written", new MetricMeta(true, "Bytes/Second"));

        /* Query Cache Units */
        addMetricMeta("status/qcache_free_blocks", new MetricMeta(false, "Blocks"));
        addMetricMeta("status/qcache_free_memory", new MetricMeta(false, "Bytes"));
        addMetricMeta("status/qcache_hits", new MetricMeta(true, "Queries/Second"));
        addMetricMeta("status/qcache_inserts", new MetricMeta(true, "Queries/Second"));
        addMetricMeta("status/qcache_lowmem_prunes", new MetricMeta(true, "Queries/Second"));
        addMetricMeta("status/qcache_not_cached", new MetricMeta(true, "Queries/Second"));
        addMetricMeta("status/qcache_queries_in_cache", new MetricMeta(false, "Queries"));
        addMetricMeta("status/qcache_total_blocks", new MetricMeta(false, "Blocks"));

        addMetricMeta("innodb_status/history_list_length", new MetricMeta(false, "Pages"));
        addMetricMeta("innodb_status/queries_inside_innodb", new MetricMeta(false, "Queries"));
        addMetricMeta("innodb_status/queries_in_queue", new MetricMeta(false, "Queries"));
        addMetricMeta("innodb_status/checkpoint_age", new MetricMeta(false, "Bytes"));

        addMetricMeta("master/position", new MetricMeta(true, "Bytes/Second"));
        addMetricMeta("slave/relay_log_pos", new MetricMeta(true, "Bytes/Second"));
    }
View Full Code Here

Examples of com.newrelic.plugins.mysql.MetricMeta

     * @param String Metric to look up
     * @return MetridMeta Structure of information about the metric
     */
    private MetricMeta getMetricMeta(String key) {
        if (key.startsWith(INNODB_MUTEX_CATEGORY) && !metricsMeta.containsKey(key)) { // This is a catch all for dynamic name metrics
            addMetricMeta(key, new MetricMeta(true, "Operations/Second"));
        }

        return metricsMeta.get(key.toLowerCase()); // Look for existing meta data on metric
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.