diff --git a/src/test/java/com/loafle/overflow/AppTest.java b/src/test/java/com/loafle/overflow/AppTest.java index f03ba10..4e03b42 100644 --- a/src/test/java/com/loafle/overflow/AppTest.java +++ b/src/test/java/com/loafle/overflow/AppTest.java @@ -63,24 +63,24 @@ public class AppTest { } @Test - @Ignore - public void testMYSQL() throws IOException { -// Object result = new SQLCrawler().getInternal( getConfig("config/mysql.json")); -// print("Mysql row", (List) result); +// @Ignore + public void testMYSQL() throws Exception { + Object result = new SQLCrawler().getInternal( getConfig("config/mysql-test.json")); + print("Mysql row", (List) result); } @Test @Ignore - public void testPGSQL() throws IOException { -// Object result = new SQLCrawler().getInternal(getConfig("config/pgsql.json")); -// print("PGSql", (List) result); + public void testPGSQL() throws Exception { + Object result = new SQLCrawler().getInternal(getConfig("config/pgsql.json")); + print("PGSql", (List) result); } @Test @Ignore - public void testSQLServerConnection_Count() throws IOException { -// Object result = new SQLCrawler().getInternal(getConfig("config/sqlserver_connection_count.json")); -// print("MSSql Server", (List) result); + public void testSQLServerConnection_Count() throws Exception { + Object result = new SQLCrawler().getInternal(getConfig("config/sqlserver_connection_count.json")); + print("MSSql Server", (List) result); } @@ -88,8 +88,8 @@ public class AppTest { @Test @Ignore - public void testSQLServerMultiKeyArray() throws IOException { -// Object result = new SQLCrawler().getInternal(getConfig("config/sqlserver_multiple_key_array.json")); -// print("MSSql Server MuoltiArray", (List< OFResultSet>) result); + public void testSQLServerMultiKeyArray() throws Exception { + Object result = new SQLCrawler().getInternal(getConfig("config/sqlserver_multiple_key_array.json")); + print("MSSql Server MuoltiArray", (List< OFResultSet>) result); } } \ No newline at end of file diff --git a/src/test/resources/config/mysql-test.json b/src/test/resources/config/mysql-test.json new file mode 100644 index 0000000..7d993fe --- /dev/null +++ b/src/test/resources/config/mysql-test.json @@ -0,0 +1,395 @@ +{ + "id": "3", + "target": { + "auth": { + "pw": "qwer5795QWER", + "id": "docker", + "url": "jdbc:mysql://192.168.1.15:33067" + }, + "connection": { + "ip": "192.168.1.15", + "port": "33067", + "portType": "TCP", + "ssl": false + } + }, + "schedule": { + "interval": "5" + }, + "crawler": { + "name": "MYSQL_CRAWLER", + "container": "java_proxy" + }, + "items": [{ + "keys": [{ + "metric": "Performance.mysql.schema.users.lost", + "key": "Performance_schema_users_lost" + }, + { + "metric": "Performance.mysql.schema.thread.instances.lost", + "key": "Performance_schema_thread_instances_lost" + }, + { + "metric": "Performance.mysql.schema.thread.classes.lost", + "key": "Performance_schema_thread_classes_lost" + }, + { + "metric": "Performance.mysql.schema.table.lock.stat.lost", + "key": "Performance_schema_table_lock_stat_lost" + }, + { + "metric": "Performance.mysql.schema.table.instances.lost", + "key": "Performance_schema_table_instances_lost" + }, + { + "metric": "Performance.mysql.schema.table.handles.lost", + "key": "Performance_schema_table_handles_lost" + }, + { + "metric": "Performance.mysql.schema.statement.classes.lost", + "key": "Performance_schema_statement_classes_lost" + }, + { + "metric": "Performance.mysql.schema.stage.classes.lost", + "key": "Performance_schema_stage_classes_lost" + }, + { + "metric": "Performance.mysql.schema.socket.instances.lost", + "key": "Performance_schema_socket_instances_lost" + }, + { + "metric": "Performance.mysql.schema.socket.classes.lost", + "key": "Performance_schema_socket_classes_lost" + }, + { + "metric": "Performance.mysql.schema.session.connect.attrs.lost", + "key": "Performance_schema_session_connect_attrs_lost" + }, + { + "metric": "Performance.mysql.schema.rwlock.instances.lost", + "key": "Performance_schema_rwlock_instances_lost" + }, + { + "metric": "Performance.mysql.schema.rwlock.classes.lost", + "key": "Performance_schema_rwlock_classes_lost" + }, + { + "metric": "Performance.mysql.schema.program.lost", + "key": "Performance_schema_program_lost" + }, + { + "metric": "Performance.mysql.schema.prepared.statements.lost", + "key": "Performance_schema_prepared_statements_lost" + }, + { + "metric": "Performance.mysql.schema.nested.statement.lost", + "key": "Performance_schema_nested_statement_lost" + }, + { + "metric": "Performance.mysql.schema.mutex.instances.lost", + "key": "Performance_schema_mutex_instances_lost" + }, + { + "metric": "Performance.mysql.schema.mutex.classes.lost", + "key": "Performance_schema_mutex_classes_lost" + }, + { + "metric": "Performance.mysql.schema.metadata.lock.lost", + "key": "Performance_schema_metadata_lock_lost" + }, + { + "metric": "Performance.mysql.schema.memory.classes.lost", + "key": "Performance_schema_memory_classes_lost" + }, + { + "metric": "Performance.mysql.schema.locker.lost", + "key": "Performance_schema_locker_lost" + }, + { + "metric": "Performance.mysql.schema.index.stat.lost", + "key": "Performance_schema_index_stat_lost" + }, + { + "metric": "Performance.mysql.schema.hosts.lost", + "key": "Performance_schema_hosts_lost" + }, + { + "metric": "Performance.mysql.schema.file.instances.lost", + "key": "Performance_schema_file_instances_lost" + }, + { + "metric": "Performance.mysql.schema.file.handles.lost", + "key": "Performance_schema_file_handles_lost" + }, + { + "metric": "Performance.mysql.schema.file.classes.lost", + "key": "Performance_schema_file_classes_lost" + }, + { + "metric": "Performance.mysql.schema.digest.lost", + "key": "Performance_schema_digest_lost" + }, + { + "metric": "Performance.mysql.schema.cond.instances.lost", + "key": "Performance_schema_cond_instances_lost" + }, + { + "metric": "Performance.mysql.schema.cond.classes.lost", + "key": "Performance_schema_cond_classes_lost" + }, + { + "metric": "Performance.mysql.schema.accounts.lost", + "key": "Performance_schema_accounts_lost" + }, + { + "metric": "Connection.mysql.Max.used.connections.time", + "key": "Max_used_connections_time" + }, + { + "metric": "Connection.mysql.Max.used.connections", + "key": "Max_used_connections" + }, + { + "metric": "Connection.mysql.connections", + "key": "Connections" + }, + { + "metric": "Connection.mysql.errors.tcpwrap", + "key": "Connection_errors_tcpwrap" + }, + { + "metric": "Connection.mysql.errors.select", + "key": "Connection_errors_select" + }, + { + "metric": "Connection.mysql.errors.peer.address", + "key": "Connection_errors_peer_address" + }, + { + "metric": "Connection.mysql.errors.max.connections", + "key": "Connection_errors_max_connections" + }, + { + "metric": "Connection.mysql.errors.internal", + "key": "Connection_errors_internal" + }, + { + "metric": "Connection.mysql.errors.accept", + "key": "Connection_errors_accept" + }, + { + "metric": "Innodb.mysql.available.undo.logs", + "key": "Innodb_available_undo_logs" + }, + { + "metric": "Innodb.mysql.truncated.status.writes", + "key": "Innodb_truncated_status_writes" + }, + { + "metric": "Innodb.mysql.num.open.files", + "key": "Innodb_num_open_files" + }, + { + "metric": "Innodb.mysql.rows.updated", + "key": "Innodb_rows_updated" + }, + { + "metric": "Innodb.mysql.rows.read", + "key": "Innodb_rows_read" + }, + { + "metric": "Innodb.mysql.rows.inserted", + "key": "Innodb_rows_inserted" + }, + { + "metric": "Innodb.mysql.rows.deleted", + "key": "Innodb_rows_deleted" + }, + { + "metric": "Innodb.mysql.row.lock.waits", + "key": "Innodb_row_lock_waits" + }, + { + "metric": "Innodb.mysql.row.lock.time.max", + "key": "Innodb_row_lock_time_max" + }, + { + "metric": "Innodb.mysql.row.lock.time.avg", + "key": "Innodb_row_lock_time_avg" + }, + { + "metric": "Innodb.mysql.row.lock.time", + "key": "Innodb_row_lock_time" + }, + { + "metric": "Innodb.mysql.row.lock.current.waits", + "key": "Innodb_row_lock_current_waits" + }, + { + "metric": "Innodb.mysql.pages.written", + "key": "Innodb_pages_written" + }, + { + "metric": "Innodb.mysql.pages.read", + "key": "Innodb_pages_read" + }, + { + "metric": "Innodb.mysql.pages.created", + "key": "Innodb_pages_created" + }, + { + "metric": "Innodb.mysql.page.size", + "key": "Innodb_page_size" + }, + { + "metric": "Innodb.mysql.os.log.written", + "key": "Innodb_os_log_written" + }, + { + "metric": "Innodb.mysql.os.log.pending.writes", + "key": "Innodb_os_log_pending_writes" + }, + { + "metric": "Innodb.mysql.os.log.pending.fsyncs", + "key": "Innodb_os_log_pending_fsyncs" + }, + { + "metric": "Innodb.mysql.os.log.fsyncs", + "key": "Innodb_os_log_fsyncs" + }, + { + "metric": "Innodb.mysql.log.writes", + "key": "Innodb_log_writes" + }, + { + "metric": "Innodb.mysql.log.write.requests", + "key": "Innodb_log_write_requests" + }, + { + "metric": "Innodb.mysql.log.waits", + "key": "Innodb_log_waits" + }, + { + "metric": "Innodb.mysql.dblwr.writes", + "key": "Innodb_dblwr_writes" + }, + { + "metric": "Innodb.mysql.dblwr.pages.written", + "key": "Innodb_dblwr_pages_written" + }, + { + "metric": "Innodb.mysql.data.written", + "key": "Innodb_data_written" + }, + { + "metric": "Innodb.mysql.data.writes", + "key": "Innodb_data_writes" + }, + { + "metric": "Innodb.mysql.data.reads", + "key": "Innodb_data_reads" + }, + { + "metric": "Innodb.mysql.data.read", + "key": "Innodb_data_read" + }, + { + "metric": "Innodb.mysql.data.pending.writes", + "key": "Innodb_data_pending_writes" + }, + { + "metric": "Innodb.mysql.data.pending.reads", + "key": "Innodb_data_pending_reads" + }, + { + "metric": "Innodb.mysql.data.pending.fsyncs", + "key": "Innodb_data_pending_fsyncs" + }, + { + "metric": "Innodb.mysql.data.fsyncs", + "key": "Innodb_data_fsyncs" + }, + { + "metric": "Innodb.mysql.buffer.pool.write.requests", + "key": "Innodb_buffer_pool_write_requests" + }, + { + "metric": "Innodb.mysql.buffer.pool.wait.free", + "key": "Innodb_buffer_pool_wait_free" + }, + { + "metric": "Innodb.mysql.buffer.pool.reads", + "key": "Innodb_buffer_pool_reads" + }, + { + "metric": "Innodb.mysql.buffer.pool.read.requests", + "key": "Innodb_buffer_pool_read_requests" + }, + { + "metric": "Innodb.mysql.buffer.pool.read.ahead.evicted", + "key": "Innodb_buffer_pool_read_ahead_evicted" + }, + { + "metric": "Innodb.mysql.buffer.pool.read.ahead", + "key": "Innodb_buffer_pool_read_ahead" + }, + { + "metric": "Innodb.mysql.buffer.pool.read.ahead.rnd", + "key": "Innodb_buffer_pool_read_ahead_rnd" + }, + { + "metric": "Innodb.mysql.buffer.pool.pages.total", + "key": "Innodb_buffer_pool_pages_total" + }, + { + "metric": "Innodb.mysql.buffer.pool.pages.misc", + "key": "Innodb_buffer_pool_pages_misc" + }, + { + "metric": "Innodb.mysql.buffer.pool.pages.free", + "key": "Innodb_buffer_pool_pages_free" + }, + { + "metric": "Innodb.mysql.buffer.pool.pages.flushed", + "key": "Innodb_buffer_pool_pages_flushed" + }, + { + "metric": "Innodb.mysql.buffer.pool.bytes.dirty", + "key": "Innodb_buffer_pool_bytes_dirty" + }, + { + "metric": "Innodb.mysql.buffer.pool.pages.dirty", + "key": "Innodb_buffer_pool_pages_dirty" + }, + { + "metric": "Innodb.mysql.buffer.pool.bytes.data", + "key": "Innodb_buffer_pool_bytes_data" + }, + { + "metric": "Innodb.mysql.buffer.pool.pages.data", + "key": "Innodb_buffer_pool_pages_data" + }, + { + "metric": "Innodb.mysql.buffer.pool.resize.status", + "key": "Innodb_buffer_pool_resize_status" + }, + { + "metric": "Innodb.mysql.buffer.pool.load.status", + "key": "Innodb_buffer_pool_load_status" + }, + { + "metric": "Innodb.mysql.buffer.pool.dump.status", + "key": "Innodb_buffer_pool_dump_status" + }], + "queryInfo": { + "query": "show status", + "extend": null + }, + "mappingInfo": { + "parseDirection": "row", + "arrayColumns": null, + "keyColumns": ["Variable_name"], + "valueColumn": "Value" + } + }] +} \ No newline at end of file