Skip to content

Commit

Permalink
Upgrade to repo tools v1.4.7 (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry authored May 2, 2017
1 parent 6eb9a91 commit bf00f58
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 772 deletions.
62 changes: 32 additions & 30 deletions monitoring/snippets/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# Stackdriver Monitoring Node.js samples
# Stackdriver Monitoring Node.js Samples

[Stackdriver Monitoring][monitoring_docs] collects metrics, events, and metadata
from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes,
application instrumentation, and a variety of common application components
including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others.
[![Build](https://storage.googleapis.com/cloud-docs-samples-badges/GoogleCloudPlatform/nodejs-docs-samples/nodejs-docs-samples-monitoring.svg)]()

[monitoring_docs]: https://cloud.google.com/monitoring/docs/
[Stackdriver Monitoring](https://cloud.google.com/monitoring/docs) collects metrics, events, and metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime probes, application instrumentation, and a variety of common application components including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others.

## Table of Contents

* [Setup](#setup)
* [Samples](#samples)
* [Metrics](#metrics)
* [Listing resources](#listing-resources)
* [Custom metrics](#custom-metrics)
* [Running the tests](#running-the-tests)
Expand All @@ -37,7 +35,8 @@ including Cassandra, Nginx, Apache Web Server, Elasticsearch and many others.

### Metrics

View the [documentation][metrics_docs] or the [source code][metrics_code].

View the [documentation][metrics_0_docs] or the [source code][metrics_0_code].

__Usage:__ `node metrics.js --help`

Expand Down Expand Up @@ -68,51 +67,54 @@ Examples:
node metrics.js create
node metrics.js list
node metrics.js get logging.googleapis.com/log_entry_count
node metrics.js delete
custom.googleapis.com/stores/daily_sales
node metrics.js delete custom.googleapis.com/stores/daily_sales
node metrics.js list-resources
node metrics.js get-resource cloudsql_database
node metrics.js write
node metrics.js read
'metric.type="compute.googleapis.com/instance/cpu/utilizatio
n"'
node metrics.js read 'metric.type="compute.googleapis.com/instance/cpu/utilization"'
node metrics.js read-fields
node metrics.js read-aggregate
node metrics.js read-reduce
For more information, see https://cloud.google.com/monitoring/docs
```

[metrics_docs]: https://cloud.google.com/monitoring/docs
[metrics_code]: metrics.js
[metrics_0_docs]: https://cloud.google.com/monitoring/docs
[metrics_0_code]: metrics.js

### Listing resources

### List resources

`list_resources.js` is a command-line program to demonstrate connecting to the Google
Monitoring API to retrieve API data.
View the [documentation][list_1_docs] or the [source code][list_1_code].

View the [documentation][list_docs] or the [source code][list_code].
`list_resources.js` is a command-line program to demonstrate connecting to the
Google Monitoring API to retrieve API data.

__Run the sample:__
__Usage:__ `node list_resources <YOUR_PROJECT_ID>`

node list_resources <your-project-id>
```
node list_resources my-cool-project
```

[list_docs]: https://cloud.google.com/monitoring/demos/#hello-world
[list_code]: list_resources.js
[list_1_docs]: https://cloud.google.com/monitoring/demos/#hello-world
[list_1_code]: list_resources.js

### Custom metric
### Custom metrics

`create_custom_metric.js` demonstrates how to create a custom metric, write a timeseries value to it,
and read it back.

View the [documentation][custom_docs] or the [source code][custom_code].
View the [documentation][metrics_2_docs] or the [source code][metrics_2_code].

__Run the sample:__
`create_custom_metric.js` demonstrates how to create a custom metric, write a
timeseries value to it, and read it back.

node create_custom_metric <your-project-id>
__Usage:__ `node create_custom_metric <YOUR_PROJECT_ID>`

```
node create_custom_metric my-cool-project
```

[custom_docs]: https://cloud.google.com/monitoring/demos/#custom_metrics
[custom_code]: create_custom_metric.js
[metrics_2_docs]: https://cloud.google.com/monitoring/demos/#custom_metrics
[metrics_2_code]: create_custom_metric.js

## Running the tests

Expand Down
44 changes: 38 additions & 6 deletions monitoring/snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@
"type": "git",
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
},
"cloud": {
"requiresKeyFile": true,
"requiresProjectId": true
},
"engines": {
"node": ">=4.3.2"
},
"scripts": {
"lint": "samples lint",
"pretest": "npm run lint",
"system-test": "ava -T 2m --verbose system-test/*.test.js",
"system-test": "ava -T 3m --verbose system-test/*.test.js",
"test": "npm run system-test"
},
"dependencies": {
Expand All @@ -28,9 +24,45 @@
"yargs": "7.1.0"
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "1.3.1",
"@google-cloud/nodejs-repo-tools": "1.4.7",
"ava": "0.19.1",
"proxyquire": "1.7.11",
"sinon": "2.1.0"
},
"cloud-repo-tools": {
"requiresKeyFile": true,
"requiresProjectId": true,
"product": "monitoring",
"samples": [
{
"id": "metrics",
"name": "Metrics",
"file": "metrics.js",
"docs_link": "https://cloud.google.com/monitoring/docs",
"usage": "node metrics.js --help"
},
{
"id": "list",
"name": "Listing resources",
"file": "list_resources.js",
"docs_link": "https://cloud.google.com/monitoring/demos/#hello-world",
"description": "`list_resources.js` is a command-line program to demonstrate connecting to the\nGoogle Monitoring API to retrieve API data.",
"usage": {
"text": "node list_resources <YOUR_PROJECT_ID>"
},
"help": "node list_resources my-cool-project"
},
{
"id": "metrics",
"name": "Custom metrics",
"file": "create_custom_metric.js",
"docs_link": "https://cloud.google.com/monitoring/demos/#custom_metrics",
"description": "`create_custom_metric.js` demonstrates how to create a custom metric, write a\ntimeseries value to it, and read it back.",
"usage": {
"text": "node create_custom_metric <YOUR_PROJECT_ID>"
},
"help": "node create_custom_metric my-cool-project"
}
]
}
}
Loading

0 comments on commit bf00f58

Please sign in to comment.