Search in sources :

Example 11 with MetricsGroup

use of com.yahoo.dba.perf.myperf.common.MetricsGroup in project mysql_perf_analyzer by yahoo.

the class MetricsDbBase method addNewUDM.

public boolean addNewUDM(UserDefinedMetrics udm) {
    if (udm == null)
        return false;
    MetricsGroup mg = udm.getMetricsGroup();
    if (!createMetricsTable(mg))
        return false;
    String tblName = mg.getSinkTableName();
    synchronized (metricsDefLock) {
        if (!this.metricsGroups.containsKey(tblName)) {
            this.metricsGroups.put(tblName, mg);
            this.dataQueues.put(tblName, new java.util.concurrent.ArrayBlockingQueue<MetricsData>(10000));
            this.insertSQL.put(tblName, this.insertSQL(mg));
        } else
            return false;
    }
    return true;
}
Also used : MetricsGroup(com.yahoo.dba.perf.myperf.common.MetricsGroup)

Aggregations

MetricsGroup (com.yahoo.dba.perf.myperf.common.MetricsGroup)11 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 Map (java.util.Map)5 UserDefinedMetrics (com.yahoo.dba.perf.myperf.common.UserDefinedMetrics)4 SQLException (java.sql.SQLException)4 Statement (java.sql.Statement)4 DBInstanceInfo (com.yahoo.dba.perf.myperf.common.DBInstanceInfo)3 Metric (com.yahoo.dba.perf.myperf.common.Metric)3 DBConnectionWrapper (com.yahoo.dba.perf.myperf.db.DBConnectionWrapper)2 ByteBuffer (java.nio.ByteBuffer)2 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 TreeMap (java.util.TreeMap)2 ModelAndView (org.springframework.web.servlet.ModelAndView)2 AlertDefinition (com.yahoo.dba.perf.myperf.common.AlertDefinition)1 AlertSubscribers (com.yahoo.dba.perf.myperf.common.AlertSubscribers)1 AppUser (com.yahoo.dba.perf.myperf.common.AppUser)1 ColumnDescriptor (com.yahoo.dba.perf.myperf.common.ColumnDescriptor)1 DBGroupInfo (com.yahoo.dba.perf.myperf.common.DBGroupInfo)1