Documentation ¶
Overview ¶
app的输出结构
Index ¶
- Constants
- Variables
- func CreateInfluxDBClient()
- func QueryContainerMonitorInfo(c *gin.Context, queryInfo Common.QueryMonitorJson)
- func QueryContainerStatus(c *gin.Context)
- func QueryContainerStatusHandler(c *gin.Context, queryInfo Common.QueryContainerStatus)
- func QueryDB(cmd string, db string) (ret []client.Result)
- func QueryMonitorInfo(c *gin.Context)
- type AppMySQLJson
- type AppMySQLQueryResult
- type AppMySQLQueryResultData
- type AppMySQLStatsJson
- type AppNginxJson
- type AppNginxQueryResult
- type AppNginxQueryResultData
- type AppNginxStatsJson
- type AppRedisJson
- type AppRedisQueryResult
- type AppRedisQueryResultData
- type AppRedisStatsJson
- type ContainerFileSystem
- type ContainerJson
- type ContainerMonitorTag
- type ContainerStatus
- type ContainerStatusUnit
- type LoginCommand
- type QueryContainerMonitor
- type QueryMonitorUnit
- type StatsInfo
Constants ¶
View Source
const ( Functions_init = "*" Functions_first = "last(*),container_name,container_uuid,environment_id,namespace,type" Value_key_of_last = "last_value" )
Variables ¶
View Source
var ArgDbHost = flag.String("influxdb_driver_host", "54.223.73.138:8086", "database host:port")
View Source
var Cli client.Client
Functions ¶
func CreateInfluxDBClient ¶
func CreateInfluxDBClient()
func QueryContainerMonitorInfo ¶
func QueryContainerMonitorInfo(c *gin.Context, queryInfo Common.QueryMonitorJson)
func QueryContainerStatus ¶
func QueryContainerStatusHandler ¶
func QueryContainerStatusHandler(c *gin.Context, queryInfo Common.QueryContainerStatus)
func QueryMonitorInfo ¶
func QueryAppMonitorInfo(c *gin.Context, queryInfo Common.QueryMonitorJson) { c.JSON(200, gin.H{ "message": "Todo app monitor system.", }) }
Types ¶
type AppMySQLJson ¶
type AppMySQLJson struct { Return_code int `json:"return_code"` Query_result []AppMySQLQueryResult `json:"query_result"` }
type AppMySQLQueryResult ¶
type AppMySQLQueryResult struct { Type string `json:"type"` Data AppMySQLQueryResultData `json:"data"` }
type AppMySQLQueryResultData ¶
type AppMySQLStatsJson ¶
type AppMySQLStatsJson struct { Timestamp string `json:"timestamp"` Connections_total float64 `json:"connections_total"` Command_query_total float64 `json:"command_query_total"` Command_insert_total float64 `json:"command_insert_total"` Command_update_total float64 `json:"command_update_total"` Command_delete_total float64 `json:"command_delete_total"` Commands_total float64 `json:"commands_total"` Handlers_total float64 `json:"handlers_total"` Connection_errors_total float64 `json:"connection_errors_total"` Buffer_pool_pages float64 `json:"buffer_pool_pages"` Thread_connected float64 `json:"thread_connected"` Max_connections float64 `json:"max_connections"` Query_response_time_seconds float64 `json:"query_reponse_time_seconds"` Read_query_response_time_seconds float64 `json:"read_query_response_time"` Write_query_response_time_seconds float64 `json:"write_query_response_time_seconds"` Queries_inside_innodb float64 `json:"queries_inside_innodb"` Queries_in_queue float64 `json:"queries_in_queue"` Read_views_open_inside_innodb float64 `json:"read_views_open_inside_innodb"` Table_statistics_rows_read_total float64 `json:"table_statistics_rows_read_total"` Table_statistics_rows_changed_total float64 `json:"table_statistics_rows_changed_total"` Table_statistics_rows_changed_x_indexes_total float64 `json:"table_statistics_rows_changed_x_indexes_total"` Sql_lock_waits_total float64 `json:"sql_lock_waits_total"` External_lock_waits_total float64 `json:"external_lock_waits_total"` Table_io_waits_total float64 `json:"table_io_waits_total"` Table_io_waits_seconds_total float64 `json:"table_io_waits_seconds_total"` }
MySQL
type AppNginxJson ¶
type AppNginxJson struct { Return_code int `json:"return_code"` Query_result []AppNginxQueryResult `json:"query_result"` }
type AppNginxQueryResult ¶
type AppNginxQueryResult struct { Type string `json:"type"` Data AppNginxQueryResultData `json:"data"` }
type AppNginxQueryResultData ¶
type AppNginxStatsJson ¶
type AppNginxStatsJson struct { Timestamp string `json:"timestamp"` Active_connections float64 `json:"active_connections"` Accepts float64 `json:"accepts"` Handled float64 `json:"handled"` Requests float64 `json:"requests"` Reading float64 `json:"reading"` Writing float64 `json:"writing"` Waiting float64 `json:"waiting"` }
Nginx
type AppRedisJson ¶
type AppRedisJson struct { Return_code int `json:"return_code"` Query_result []AppRedisQueryResult `json:"query_result"` }
type AppRedisQueryResult ¶
type AppRedisQueryResult struct { Type string `json:"type"` Data AppRedisQueryResultData `json:"data"` }
type AppRedisQueryResultData ¶
type AppRedisStatsJson ¶
type AppRedisStatsJson struct { Timestamp string `json:"timestamp"` Uptime_in_seconds float64 `json:"uptime_in_seconds"` Connected_clients float64 `json:"connected_clients"` Blocked_clients float64 `json:"blocked_clients"` Used_memory float64 `json:"used_memory"` Used_memory_rss float64 `json:"used_memory_rss"` Used_memory_peak float64 `json:"used_memory_peak"` Used_memory_lua float64 `json:"used_memory_lua"` Max_memory float64 `json:"max_memory"` Mem_fragmentation_ratio float64 `json:"mem_fragmentation_ratio"` Rdb_changes_since_last_save float64 `json:"rdb_changes_since_last_save"` Rdb_last_bgsave_time_sec float64 `json:"rdb_last_bgsave_time_sec"` Rdb_current_bgsave_time_sec float64 `json:"rdb_current_bgsave_time_sec"` Aof_enabled float64 `json:"aof_enabled"` Aof_rewrite_in_progress float64 `json:"aof_rewrite_in_progress"` Aof_rewrite_scheduled float64 `json:"aof_rewrite_scheduled"` Aof_last_rewrite_time_sec float64 `json:"aof_last_rewrite_time_sec"` Aof_current_rewrite_time_sec float64 `json:"aof_current_rewrite_time_sec"` Total_connections_received float64 `json:"total_connections_received"` Total_commands_processed float64 `json:"total_commands_processed"` Total_net_input_bytes float64 `json:"total_net_input_bytes"` Total_net_output_bytes float64 `json:"total_net_output_bytes"` Rejected_connections float64 `json:"rejected_connections"` Expired_keys float64 `json:"expired_keys"` Evicted_keys float64 `json:"evicted_keys"` Keyspace_hits float64 `json:"keyspace_hits"` Keyspace_misses float64 `json:"keyspace_misses"` Pubsub_channels float64 `json:"pubsub_channels"` Pubsub_patterns float64 `json:"pubsub_patterns"` Loading float64 `json:"loading"` Connected_slaves float64 `json:"connected_slaves"` Repl_backlog_size float64 `json:"repl_backlog_size"` Used_cpu_sys float64 `json:"used_cpu_sys"` Used_cpu_user float64 `json:"used_cpu_user"` Used_cpu_sys_children float64 `json:"used_cpu_sys_children"` Used_cpu_user_children float64 `json:"used_cpu_user_children"` }
Redis
type ContainerFileSystem ¶
type ContainerFileSystem struct { Container_filesystem_name string `json:"container_filesystem_name"` Container_filesystem_type string `json:"container_filesystem_type"` Container_filesystem_capacity int `json:"container_filesystem_capacity"` Container_filesystem_usage int `json:"container_filesystem_usage"` }
type ContainerJson ¶
type ContainerJson struct { Type string `json:"type"` Data struct { Container_uuid string `json:"container_uuid"` Environment_id string `json:"environment_id"` Namespace string `json:"namespace"` Container_name string `json:"container_name"` Timestamp string `json:"timestamp"` Log_info struct { Log_time string `json:"log_time"` Source string `json:"source"` Message string `json:"message"` } `json:"log_info"` } `json:"data"` }
type ContainerMonitorTag ¶
type ContainerStatus ¶
type ContainerStatus struct { Return_code int `json:"return_code"` Container_num int `json:"container_num"` Query_result []ContainerStatusUnit `json:"query_result"` }
type ContainerStatusUnit ¶
type LoginCommand ¶
type QueryContainerMonitor ¶
type QueryContainerMonitor struct { Return_code int `json:"return_code"` Query_result []QueryMonitorUnit `json:"query_result"` }
type QueryMonitorUnit ¶
type QueryMonitorUnit struct { Type string `json:"type"` Data struct { Timestamp string `json:"timestamp"` Container_uuid string `json:"container_uuid"` Environment_id string `json:"environment_id"` Container_name string `json:"container_name"` Namespace string `json:"namespace"` Stats StatsInfo `json:"stats"` } `json:"data"` }
type StatsInfo ¶
type StatsInfo struct { Timestamp string `json:"timestamp"` Container_cpu_usage_seconds_total int `json:"container_cpu_usage_seconds_total"` Container_cpu_user_seconds_total int `json:"container_cpu_user_seconds_total"` Container_cpu_system_seconds_total int `json:"container_cpu_system_seconds_total"` Container_memory_usage_bytes int `json:"container_memory_usage_bytes"` Container_memory_limit_bytes int `json:"container_memory_limit_bytes"` Container_memory_cache int `json:"container_memory_cache"` Container_memory_rss int `json:"container_memory_rss"` Container_memory_swap int `json:"container_memory_swap"` Container_network_receive_bytes_total int `json:"container_network_receive_bytes_total"` Container_network_receive_packets_total int `json:"container_network_receive_packets_total"` Container_network_receive_packets_dropped_total int `json:"container_network_receive_packets_dropped_total"` Container_network_receive_errors_total int `json:"container_network_receive_errors_total"` Container_network_transmit_bytes_total int `json:"container_network_transmit_bytes_total"` Container_network_transmit_packets_total int `json:"container_network_transmit_packets_total"` Container_network_transmit_packets_dropped_total int `json:"container_network_transmit_packets_dropped_total"` Container_network_transmit_errors_total int `json:"container_network_transmit_errors_total"` Container_filesystem []ContainerFileSystem `json:"container_filesystem"` Container_diskio_service_bytes_async int `json:"container_diskio_service_bytes_async"` Container_diskio_service_bytes_read int `json:"container_diskio_service_bytes_read"` Container_diskio_service_bytes_sync int `json:"container_diskio_service_bytes_sync"` Container_diskio_service_bytes_total int `json:"container_diskio_service_bytes_total"` Container_diskio_service_bytes_write int `json:"container_diskio_service_bytes_write"` Container_tasks_state_nr_sleeping int `json:"container_tasks_state_nr_sleeping"` Container_tasks_state_nr_running int `json:"container_tasks_state_nr_running"` Container_tasks_state_nr_stopped int `json:"container_tasks_state_nr_stopped"` Container_tasks_state_nr_uninterruptible int `json:"container_tasks_state_nr_uninterruptible"` Container_tasks_state_nr_io_wait int `json:"container_tasks_state_nr_io_wait"` }
Click to show internal directories.
Click to hide internal directories.