Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table gcp_sql_database_instance_metric_connections closes #266 #267

Merged
merged 8 commits into from
Jul 8, 2021

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Jun 29, 2021

Integration test logs

Logs
Add passing integration test logs here

Example query results

Results

Basic Info

select
  instance_id,
  timestamp,
  minimum,
  maximum,
  average,
  sample_count
from
  gcp_sql_database_instance_connections
+-----------------------+----------------------+---------+---------+---------+--------------+
| instance_id           | timestamp            | minimum | maximum | average | sample_count |
+-----------------------+----------------------+---------+---------+---------+--------------+
| parker-aaa:db-connect | 2021-06-28T10:46:00Z | 8       | 9       | 8.8     | 5            |
| parker-aaa:db-connect | 2021-06-28T10:51:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T10:56:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:01:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:06:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:11:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:16:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:21:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:26:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:31:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:36:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:41:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:46:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:51:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T11:56:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:01:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:06:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:11:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:16:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:21:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:26:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:31:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:36:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:41:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:46:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:51:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T12:56:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:01:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:06:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:11:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:16:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:21:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:26:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:31:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:36:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:41:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:46:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:51:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T13:56:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:01:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:06:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:11:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:16:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:21:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:26:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:31:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:36:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:41:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:46:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:51:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T14:56:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T15:01:00Z | 9       | 9       | 9       | 5            |
| parker-aaa:db-connect | 2021-06-28T15:06:00Z | 9       | 9       | 9       | 5            |

Intervals averaging fewer than 9 connections

select
  instance_id,
  timestamp,
  round(minimum::numeric,2) as min_connection,
  round(maximum::numeric,2) as max_connection,
  round(average::numeric,2) as avg_connection,
  sample_count
from
  gcp_sql_database_instance_connections
where average < 9
+-----------------------+----------------------+----------------+----------------+----------------+--------------+
| instance_id           | timestamp            | min_connection | max_connection | avg_connection | sample_count |
+-----------------------+----------------------+----------------+----------------+----------------+--------------+
| parker-aaa:db-connect | 2021-06-28T10:43:00Z | 8.00           | 9.00           | 8.50           | 2            |
+-----------------------+----------------------+----------------+----------------+----------------+--------------+

@ParthaI ParthaI requested a review from Subhajit97 June 29, 2021 07:17
@ParthaI ParthaI self-assigned this Jun 29, 2021
@ParthaI ParthaI linked an issue Jun 29, 2021 that may be closed by this pull request
@Subhajit97 Subhajit97 requested a review from rajlearner17 June 29, 2021 13:03
func tableGcpSQLDatabaseInstanceConnectionsMetric(_ context.Context) *plugin.Table {
return &plugin.Table{
Name: "gcp_sql_database_instance_metric_connections",
Description: "GCP SQL Database Instance Metrics Connections",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, should it be gcp_sql_database_instance_connections

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rajmohanty17 We have followed same naming pattern defined in AWS

Copy link

@rajlearner17 rajlearner17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls check once on the comments.

@Subhajit97 Subhajit97 changed the title Add table gcp_sql_database_instance_connections closes #266 Add table gcp_sql_database_instance_metric_connections closes #266 Jun 30, 2021
@Subhajit97 Subhajit97 requested a review from rajlearner17 June 30, 2021 14:02
Copy link

@rajlearner17 rajlearner17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Subhajit97 Subhajit97 requested a review from cbruno10 July 5, 2021 13:57
@cbruno10 cbruno10 merged commit d0f9627 into main Jul 8, 2021
@cbruno10 cbruno10 deleted the issue-266 branch July 8, 2021 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table gcp_sql_database_instance_connections
4 participants