| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 872391f commit 5e6760e
29 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,8 @@ | |||
| 1 | 1 | # Cloud Machine Learning Engine - Online Prediction with Java | |
| 2 | 2 | ||
| 3 | + <a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=mlengine/online-prediction/README.md"> | ||
| 4 | + <img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a> | ||
| 5 | + | ||
| 3 | 6 | ## Setup | |
| 4 | 7 | This sample demonstrates how to send online prediction requests to your deployed | |
| 5 | 8 | model on CMLE. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,21 @@ limitations under the License. | |||
| 17 | 17 | <artifactId>mlengine-online-prediction</artifactId> | |
| 18 | 18 | <version>1</version> | |
| 19 | 19 | ||
| 20 | + <!-- | ||
| 21 | + The parent pom defines common style checks and testing strategies for our samples. | ||
| 22 | + Removing or replacing it should not affect the execution of the samples in anyway. | ||
| 23 | + --> | ||
| 24 | + <parent> | ||
| 25 | + <groupId>com.google.cloud.samples</groupId> | ||
| 26 | + <artifactId>shared-configuration</artifactId> | ||
| 27 | + <version>1.0.8</version> | ||
| 28 | + </parent> | ||
| 29 | + | ||
| 30 | + <properties> | ||
| 31 | + <maven.compiler.target>1.8</maven.compiler.target> | ||
| 32 | + <maven.compiler.source>1.8</maven.compiler.source> | ||
| 33 | + </properties> | ||
| 34 | + | ||
| 20 | 35 | <build> | |
| 21 | 36 | <plugins> | |
| 22 | 37 | <plugin> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,9 @@ | |||
| 1 | 1 | # Getting Started with Google Stackdriver Monitoring API and the Google Cloud Client libraries | |
| 2 | 2 | ||
| 3 | + <a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=monitoring/cloud-client/README.md"> | ||
| 4 | + <img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a> | ||
| 5 | + | ||
| 6 | + | ||
| 3 | 7 | [Google Stackdriver Monitoring API][monitoring] collects metrics, events, and | |
| 4 | 8 | metadata from Google Cloud Platform, Amazon Web Services (AWS), hosted uptime | |
| 5 | 9 | probes, application instrumentation, and a variety of common application | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,18 +19,19 @@ | |||
| 19 | 19 | <artifactId>monitoring-google-cloud-samples</artifactId> | |
| 20 | 20 | <packaging>jar</packaging> | |
| 21 | 21 | ||
| 22 | - <!-- Parent defines config for testing & linting. --> | ||
| 22 | + <!-- | ||
| 23 | + The parent pom defines common style checks and testing strategies for our samples. | ||
| 24 | + Removing or replacing it should not affect the execution of the samples in anyway. | ||
| 25 | + --> | ||
| 23 | 26 | <parent> | |
| 24 | - <artifactId>doc-samples</artifactId> | ||
| 25 | - <groupId>com.google.cloud</groupId> | ||
| 26 | - <version>1.0.0</version> | ||
| 27 | - <relativePath>../..</relativePath> | ||
| 27 | + <groupId>com.google.cloud.samples</groupId> | ||
| 28 | + <artifactId>shared-configuration</artifactId> | ||
| 29 | + <version>1.0.8</version> | ||
| 28 | 30 | </parent> | |
| 29 | 31 | ||
| 30 | 32 | <properties> | |
| 31 | 33 | <maven.compiler.target>1.8</maven.compiler.target> | |
| 32 | 34 | <maven.compiler.source>1.8</maven.compiler.source> | |
| 33 | - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| 34 | 35 | </properties> | |
| 35 | 36 | ||
| 36 | 37 | <!-- Workaround for issue : https://github.com/GoogleCloudPlatform/google-cloud-java/issues/2192 --> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,42 +1,43 @@ | |||
| 1 | 1 | /* | |
| 2 | - Copyright 2017, Google, Inc. | ||
| 3 | - | ||
| 4 | - Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | - you may not use this file except in compliance with the License. | ||
| 6 | - You may obtain a copy of the License at | ||
| 7 | - | ||
| 8 | - http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | - | ||
| 10 | - Unless required by applicable law or agreed to in writing, software | ||
| 11 | - distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | - See the License for the specific language governing permissions and | ||
| 14 | - limitations under the License. | ||
| 15 | - */ | ||
| 2 | + * Copyright 2017 Google Inc. | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | 16 | ||
| 17 | 17 | package com.example.monitoring; | |
| 18 | 18 | ||
| 19 | + //CHECKSTYLE OFF: VariableDeclarationUsageDistance | ||
| 19 | 20 | // [START monitoring_quickstart] | |
| 21 | + | ||
| 20 | 22 | import com.google.api.Metric; | |
| 21 | 23 | import com.google.api.MonitoredResource; | |
| 22 | - | ||
| 23 | - // Imports the Google Cloud client library | ||
| 24 | 24 | import com.google.cloud.monitoring.v3.MetricServiceClient; | |
| 25 | - | ||
| 26 | 25 | import com.google.monitoring.v3.CreateTimeSeriesRequest; | |
| 27 | 26 | import com.google.monitoring.v3.Point; | |
| 28 | 27 | import com.google.monitoring.v3.ProjectName; | |
| 29 | 28 | import com.google.monitoring.v3.TimeInterval; | |
| 30 | 29 | import com.google.monitoring.v3.TimeSeries; | |
| 31 | 30 | import com.google.monitoring.v3.TypedValue; | |
| 32 | 31 | import com.google.protobuf.util.Timestamps; | |
| 33 | - | ||
| 34 | 32 | import java.util.ArrayList; | |
| 35 | 33 | import java.util.HashMap; | |
| 36 | 34 | import java.util.List; | |
| 37 | 35 | import java.util.Map; | |
| 38 | 36 | ||
| 37 | + // Imports the Google Cloud client library | ||
| 38 | + | ||
| 39 | 39 | public class QuickstartSample { | |
| 40 | + | ||
| 40 | 41 | public static void main(String... args) throws Exception { | |
| 41 | 42 | // Your Google Cloud Platform project ID | |
| 42 | 43 | String projectId = System.getProperty("projectId"); | |
@@ -105,3 +106,4 @@ public static void main(String... args) throws Exception { | |||
| 105 | 106 | } | |
| 106 | 107 | } | |
| 107 | 108 | // [END monitoring_quickstart] | |
| 109 | + //CHECKSTYLE ON: VariableDeclarationUsageDistance | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | * you may not use this file except in compliance with the License. | |
| 6 | 6 | * You may obtain a copy of the License at | |
| 7 | 7 | * | |
| 8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | 9 | * | |
| 10 | 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
@@ -37,7 +37,6 @@ | |||
| 37 | 37 | import com.google.monitoring.v3.TypedValue; | |
| 38 | 38 | import com.google.protobuf.Duration; | |
| 39 | 39 | import com.google.protobuf.util.Timestamps; | |
| 40 | - | ||
| 41 | 40 | import java.io.IOException; | |
| 42 | 41 | import java.util.ArrayList; | |
| 43 | 42 | import java.util.HashMap; | |
@@ -134,6 +133,7 @@ void deleteMetricDescriptor(String name) throws IOException { | |||
| 134 | 133 | * DOUBLE value_type and GAUGE metric kind. If the metric descriptor | |
| 135 | 134 | * doesn't exist, it will be auto-created. | |
| 136 | 135 | */ | |
| 136 | + //CHECKSTYLE OFF: VariableDeclarationUsageDistance | ||
| 137 | 137 | void writeTimeSeries() throws IOException { | |
| 138 | 138 | // [START monitoring_write_timeseries] | |
| 139 | 139 | String projectId = System.getProperty("projectId"); | |
@@ -194,6 +194,7 @@ void writeTimeSeries() throws IOException { | |||
| 194 | 194 | System.out.println("Done writing time series value."); | |
| 195 | 195 | // [END monitoring_write_timeseries] | |
| 196 | 196 | } | |
| 197 | + //CHECKSTYLE ON: VariableDeclarationUsageDistance | ||
| 197 | 198 | ||
| 198 | 199 | /** | |
| 199 | 200 | * Demonstrates listing time series headers. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,32 +1,31 @@ | |||
| 1 | 1 | /* | |
| 2 | - Copyright 2016, Google, Inc. | ||
| 3 | - | ||
| 4 | - Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | - you may not use this file except in compliance with the License. | ||
| 6 | - You may obtain a copy of the License at | ||
| 7 | - | ||
| 8 | - http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | - | ||
| 10 | - Unless required by applicable law or agreed to in writing, software | ||
| 11 | - distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | - See the License for the specific language governing permissions and | ||
| 14 | - limitations under the License. | ||
| 15 | - */ | ||
| 2 | + * Copyright 2016 Google Inc. | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | 16 | ||
| 17 | 17 | package com.example.monitoring; | |
| 18 | 18 | ||
| 19 | 19 | import static com.google.common.truth.Truth.assertThat; | |
| 20 | 20 | ||
| 21 | + import java.io.ByteArrayOutputStream; | ||
| 22 | + import java.io.PrintStream; | ||
| 21 | 23 | import org.junit.After; | |
| 22 | 24 | import org.junit.Before; | |
| 23 | 25 | import org.junit.Test; | |
| 24 | 26 | import org.junit.runner.RunWith; | |
| 25 | 27 | import org.junit.runners.JUnit4; | |
| 26 | 28 | ||
| 27 | - import java.io.ByteArrayOutputStream; | ||
| 28 | - import java.io.PrintStream; | ||
| 29 | - | ||
| 30 | 29 | /** | |
| 31 | 30 | * Tests for quickstart sample. | |
| 32 | 31 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,32 +1,31 @@ | |||
| 1 | 1 | /* | |
| 2 | - Copyright 2016, Google, Inc. | ||
| 3 | - | ||
| 4 | - Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | - you may not use this file except in compliance with the License. | ||
| 6 | - You may obtain a copy of the License at | ||
| 7 | - | ||
| 8 | - http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | - | ||
| 10 | - Unless required by applicable law or agreed to in writing, software | ||
| 11 | - distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | - See the License for the specific language governing permissions and | ||
| 14 | - limitations under the License. | ||
| 15 | - */ | ||
| 2 | + * Copyright 2016 Google Inc. | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + */ | ||
| 16 | 16 | ||
| 17 | 17 | package com.example.monitoring; | |
| 18 | 18 | ||
| 19 | 19 | import static com.google.common.truth.Truth.assertThat; | |
| 20 | 20 | ||
| 21 | + import java.io.ByteArrayOutputStream; | ||
| 22 | + import java.io.PrintStream; | ||
| 21 | 23 | import org.junit.After; | |
| 22 | 24 | import org.junit.Before; | |
| 23 | 25 | import org.junit.Test; | |
| 24 | 26 | import org.junit.runner.RunWith; | |
| 25 | 27 | import org.junit.runners.JUnit4; | |
| 26 | 28 | ||
| 27 | - import java.io.ByteArrayOutputStream; | ||
| 28 | - import java.io.PrintStream; | ||
| 29 | - | ||
| 30 | 29 | /** | |
| 31 | 30 | * Tests for quickstart sample. | |
| 32 | 31 | */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,10 +33,6 @@ | |||
| 33 | 33 | ||
| 34 | 34 | <maven.compiler.target>1.8</maven.compiler.target> | |
| 35 | 35 | <maven.compiler.source>1.8</maven.compiler.source> | |
| 36 | - | ||
| 37 | - <spanner.test.instance>default-instance</spanner.test.instance> | ||
| 38 | - <spanner.sample.database>mysample</spanner.sample.database> | ||
| 39 | - <spanner.quickstart.database>quickstart-db</spanner.quickstart.database> | ||
| 40 | 36 | </properties> | |
| 41 | 37 | ||
| 42 | 38 | <modules> | |
@@ -72,6 +68,8 @@ | |||
| 72 | 68 | ||
| 73 | 69 | <module>logging</module> | |
| 74 | 70 | ||
| 71 | + <module>mlengine/online-prediction</module> | ||
| 72 | + | ||
| 75 | 73 | <module>monitoring/cloud-client</module> | |
| 76 | 74 | ||
| 77 | 75 | <module>pubsub/cloud-client</module> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,8 @@ | |||
| 1 | 1 | # Getting Started with Cloud Pub/Sub and the Google Cloud Client libraries | |
| 2 | 2 | ||
| 3 | + <a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=pubsub/cloud-client/README.md"> | ||
| 4 | + <img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a> | ||
| 5 | + | ||
| 3 | 6 | [Google Cloud Pub/Sub][pubsub] is a fully-managed real-time messaging service that allows you to | |
| 4 | 7 | send and receive messages between independent applications. | |
| 5 | 8 | This sample Java application demonstrates how to access the Pub/Sub API using | |
| Back | FazBrowse Home | New Git URL |
0 commit comments