Search in sources :

Example 21 with LogStopWatch

use of com.serotonin.log.LogStopWatch in project ma-core-public by infiniteautomation.

the class BaseSqlQuery method immediateCount.

/**
 * Execute the Count if there is one
 */
public long immediateCount() {
    if (countSql == null)
        return 0;
    LogStopWatch stopWatch = null;
    if (this.useMetrics)
        stopWatch = new LogStopWatch();
    long count = this.dao.queryForObject(countSql, countArgs.toArray(), Long.class, new Long(0));
    if (this.useMetrics)
        stopWatch.stop("Count: " + countSql + " \nArgs: " + countArgs.toString(), this.metricsThreshold);
    return count;
}
Also used : LogStopWatch(com.serotonin.log.LogStopWatch)

Example 22 with LogStopWatch

use of com.serotonin.log.LogStopWatch in project ma-core-public by infiniteautomation.

the class PointValueDaoMetrics method getPointValuesBetween.

/* (non-Javadoc)
     * @see com.serotonin.m2m2.db.dao.PointValueDao#getPointValuesBetween(java.util.List, long, long, boolean, java.lang.Integer, com.infiniteautomation.mango.db.query.PVTQueryCallback)
     */
@Override
public void getPointValuesBetween(List<Integer> ids, long from, long to, boolean orderById, Integer limit, PVTQueryCallback<IdPointValueTime> callback) {
    LogStopWatch logStopWatch = new LogStopWatch();
    dao.getPointValuesBetween(ids, from, to, orderById, limit, callback);
    logStopWatch.stop("getPointValuesBetween(dataPointIds, from, to, orderById, limit, callback) + (" + ids + ", " + to + ", " + from + ", " + limit + "callback)", this.metricsThreshold);
}
Also used : LogStopWatch(com.serotonin.log.LogStopWatch)

Example 23 with LogStopWatch

use of com.serotonin.log.LogStopWatch in project ma-core-public by infiniteautomation.

the class PointValueDaoMetrics method wideQuery.

/* (non-Javadoc)
	 * @see com.serotonin.m2m2.db.dao.PointValueDao#wideQuery(int, long, long, com.serotonin.db.WideQueryCallback)
	 */
@Override
public void wideQuery(int pointId, long from, long to, WideQueryCallback<PointValueTime> callback) {
    LogStopWatch LogStopWatch = new LogStopWatch();
    dao.wideQuery(pointId, from, to, callback);
    LogStopWatch.stop("wideQuery(pointId,from,to,callback) (" + pointId + ", " + from + ", " + to + ", " + callback.toString() + ")", this.metricsThreshold);
}
Also used : LogStopWatch(com.serotonin.log.LogStopWatch)

Example 24 with LogStopWatch

use of com.serotonin.log.LogStopWatch in project ma-core-public by infiniteautomation.

the class PointValueDaoMetrics method getInceptionDate.

/* (non-Javadoc)
	 * @see com.serotonin.m2m2.db.dao.PointValueDao#getInceptionDate(int)
	 */
@Override
public long getInceptionDate(int pointId) {
    LogStopWatch LogStopWatch = new LogStopWatch();
    long value = dao.getInceptionDate(pointId);
    LogStopWatch.stop("getInceptionDate(pointId) (" + pointId + ")", this.metricsThreshold);
    return value;
}
Also used : LogStopWatch(com.serotonin.log.LogStopWatch)

Example 25 with LogStopWatch

use of com.serotonin.log.LogStopWatch in project ma-core-public by infiniteautomation.

the class PointValueDaoMetrics method deletePointValue.

/* (non-Javadoc)
	 * @see com.serotonin.m2m2.db.dao.PointValueDao#deletePointValue(int)
	 */
@Override
public long deletePointValue(int dataPointId, long ts) {
    LogStopWatch LogStopWatch = new LogStopWatch();
    long value = dao.deletePointValue(dataPointId, ts);
    LogStopWatch.stop("deletePointValue(dataPointId, ts) + (" + dataPointId + ", " + ts + ")", this.metricsThreshold);
    return value;
}
Also used : LogStopWatch(com.serotonin.log.LogStopWatch)

Aggregations

LogStopWatch (com.serotonin.log.LogStopWatch)45 IdPointValueTime (com.serotonin.m2m2.rt.dataImage.IdPointValueTime)9 PointValueTime (com.serotonin.m2m2.rt.dataImage.PointValueTime)9 ResultSet (java.sql.ResultSet)3 LogEvent (com.serotonin.m2m2.rt.console.LogEvent)2 IOException (java.io.IOException)2 PreparedStatement (java.sql.PreparedStatement)2 Simplify (com.goebl.simplify.Simplify)1 DataPointVOPointValueTimeBookend (com.infiniteautomation.mango.rest.v2.model.pointValue.DataPointVOPointValueTimeBookend)1 ModuleNotLoadedException (com.serotonin.ModuleNotLoadedException)1 ShouldNeverHappenException (com.serotonin.ShouldNeverHappenException)1 UserEventCache (com.serotonin.m2m2.rt.event.UserEventCache)1 LongPair (com.serotonin.m2m2.vo.pair.LongPair)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 Record (org.jooq.Record)1 Record1 (org.jooq.Record1)1 DataAccessException (org.springframework.dao.DataAccessException)1 RowMapper (org.springframework.jdbc.core.RowMapper)1