turbot / steampipe

Zero-ETL, infinite possibilities. Live query APIs, code & more with SQL. No DB required.
https://steampipe.io
GNU Affero General Public License v3.0
6.67k stars 262 forks source link

JSON metadata output should not contain scan info when `--timing=on` #4292

Closed pskrbasu closed 6 days ago

pskrbasu commented 1 month ago

JSON metadata output should not contain scan info when --timing=on. The scans info should only be there for --timing=verbose

metadata is same for both. --timing=on --output=json

"metadata": {
  "duration_ms": 3349,
  "scans": [
   {
    "connection": "aws",
    "table": "aws_account",
    "cache_hit": false,
    "rows_fetched": 1,
    "hydrate_calls": 2,
    "start_time": "2024-05-31T14:18:01+05:30",
    "duration_ms": 3295,
    "columns": [
     "account_aliases",
     "organization_feature_set",
     "organization_master_account_id",
     "organization_id",
     "organization_arn",
     "title",
     "account_id",
     "arn",
     "organization_available_policy_types",
     "akas",
     "sp_connection_name",
     "sp_ctx",
     "organization_master_account_arn",
     "organization_master_account_email",
     "partition",
     "region",
     "_ctx"
    ]
   }
  ],
  "scan_count": 1,
  "rows_returned": 1,
  "uncached_rows_fetched": 1,
  "cached_rows_fetched": 0,
  "hydrate_calls": 2,
  "connection_count": 1
 }

--timing=verbose --output=json

"metadata": {
  "duration_ms": 3646,
  "scans": [
   {
    "connection": "aws",
    "table": "aws_account",
    "cache_hit": false,
    "rows_fetched": 1,
    "hydrate_calls": 2,
    "start_time": "2024-05-31T14:25:54+05:30",
    "duration_ms": 3590,
    "columns": [
     "sp_ctx",
     "organization_master_account_arn",
     "organization_master_account_email",
     "title",
     "region",
     "sp_connection_name",
     "arn",
     "organization_arn",
     "organization_master_account_id",
     "partition",
     "account_aliases",
     "organization_id",
     "organization_feature_set",
     "account_id",
     "organization_available_policy_types",
     "akas",
     "_ctx"
    ]
   }
  ],
  "scan_count": 1,
  "rows_returned": 1,
  "uncached_rows_fetched": 1,
  "cached_rows_fetched": 0,
  "hydrate_calls": 2,
  "connection_count": 1
 }