|
| 1 | +package h002 |
| 2 | + |
| 3 | +import checkup ".." |
| 4 | + |
| 5 | +type H002Index struct { |
| 6 | + Num int `json:"num"` |
| 7 | + Reason string `json:"reason"` |
| 8 | + IndexId string `json:"index_id"` |
| 9 | + SchemaName string `json:"schema_name"` |
| 10 | + TableName string `json:"table_name"` |
| 11 | + IndexName string `json:"index_name"` |
| 12 | + IdxScan int64 `json:"idx_scan"` |
| 13 | + AllScans int64 `json:"all_scans"` |
| 14 | + IndexScanPct float64 `json:"index_scan_pct"` |
| 15 | + Writes int64 `json:"writes"` |
| 16 | + ScansPerWrite float64 `json:"scans_per_write"` |
| 17 | + IndexSizeBytes int64 `json:"index_size_bytes"` |
| 18 | + TableSizeBytes int64 `json:"table_size_bytes"` |
| 19 | + Relpages int64 `json:"relpages"` |
| 20 | + IdxIsBtree bool `json:"idx_is_btree"` |
| 21 | + IndexDef string `json:"index_def"` |
| 22 | + FormatedIndexName string `json:"formated_index_name"` |
| 23 | + FormatedSchemaName string `json:"formated_schema_name"` |
| 24 | + FormatedTableName string `json:"formated_table_name"` |
| 25 | + FormatedRelationName string `json:"formated_relation_name"` |
| 26 | + Opclasses string `json:"opclasses"` |
| 27 | + SupportsFk bool `json:"supports_fk"` |
| 28 | + Grp int64 `json:"grp"` |
| 29 | +} |
| 30 | + |
| 31 | +type H002Indexes map[string]H002Index |
| 32 | + |
| 33 | +type H002IndexesTotal struct { |
| 34 | + IndexSizeBytesSum int64 `json:"index_size_bytes_sum"` |
| 35 | + TableSizeBytesSum int64 `json:"table_size_bytes_sum"` |
| 36 | +} |
| 37 | + |
| 38 | +type DatabaseStat struct { |
| 39 | + StatsReset string `json:"stats_reset"` |
| 40 | + StatsAge string `json:"stats_age"` |
| 41 | + Days int64 `json:"days"` |
| 42 | + DatabaseSizeBytes int64 `json:"database_size_bytes"` |
| 43 | +} |
| 44 | + |
| 45 | +type H002ReportHostResultData struct { |
| 46 | + NeverUsedIndexes H002Indexes `json:"never_used_indexes"` |
| 47 | + NeverUsedIndexesTotal H002IndexesTotal `json:"never_used_indexes_total"` |
| 48 | + RarelyUsedIsndexes H002Indexes `json:"rarely_used_indexes"` |
| 49 | + RarelyUsedIndexesTotal H002IndexesTotal `json:"rarely_used_indexes_total"` |
| 50 | + Do []string `json:"do"` |
| 51 | + UnDo []string `json:"undo"` |
| 52 | + DatabaseStat DatabaseStat `json:"database_stat"` |
| 53 | + MinIndexSizeBytes int64 `json:"min_index_size_bytes"` |
| 54 | +} |
| 55 | + |
| 56 | +type H002ReportHostResult struct { |
| 57 | + Data H002ReportHostResultData `json:"data"` |
| 58 | + NodesJson checkup.ReportLastNodes `json:"nodes.json"` |
| 59 | +} |
| 60 | + |
| 61 | +type H002ReportHostsResults map[string]H002ReportHostResult |
| 62 | + |
| 63 | +type H002Report struct { |
| 64 | + Project string `json:"project"` |
| 65 | + Name string `json:"name"` |
| 66 | + CheckId string `json:"checkId"` |
| 67 | + Timestamptz string `json:"timestamptz"` |
| 68 | + Database string `json:"database"` |
| 69 | + Dependencies map[string]interface{} `json:"dependencies"` |
| 70 | + LastNodesJson checkup.ReportLastNodes `json:"last_nodes_json"` |
| 71 | + Results H002ReportHostsResults `json:"results"` |
| 72 | +} |
0 commit comments