SQL Sensor
SQL Sensor
Concept
The ConfigReader parses the novapy-agent-configfile and adds the sensors. Because the concrete classes to monitor for sql-statements are not known at this moment, the necessary methodsensors are added if a class, implementing a defined interfaces, is loaded. The ByteCodeAnalyzer checks these conditions if the sqlsensor is active. Then the hooks are inserted and registered. The SQLTimerHook gets the sql-statement and adds the measurement to the coreService.addMethodSensorData. The sensor has the parameter which package is scanned for sql-statements and the name for the sensor. The "*" represents all packages.
Usage
The SQL-Sensor has to be loaded in the novaspy-agent.cfg file with
sql-sensor-type info.novatec.novaspy.agent.sensor.method.jdbc.SQLTimerSensor MAX sql-sensor * sqltest1 sql-sensor-type info.novatec.novaspy.agent.sensor.method.jdbc.SQLTimerSensor MAX sql-sensor org.postgresql.jdbc2 sqltest2