forked from eclipse-che/che
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0cef67
commit 0caa49f
Showing
4 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...y-wsagent-war/src/main/java/org/eclipse/che/wsagent/server/WsAgentAnalyticsAddresser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2016 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.che.wsagent.server; | ||
|
||
import org.eclipse.che.commons.schedule.ScheduleRate; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import javax.inject.Singleton; | ||
import javax.net.ssl.HttpsURLConnection; | ||
import java.io.IOException; | ||
import java.net.HttpURLConnection; | ||
import java.net.URL; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Singleton | ||
public class WsAgentAnalyticsAddresser { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(WsAgentAnalyticsAddresser.class); | ||
|
||
@ScheduleRate(period = 1, unit = TimeUnit.HOURS) | ||
void send() { | ||
HttpURLConnection connection = null; | ||
try { | ||
final URL url = new URL("https://install.codenvycorp.com/che/telemetry/workspace"); | ||
connection = (HttpsURLConnection)url.openConnection(); | ||
connection.getResponseCode(); | ||
} catch (IOException e) { | ||
LOG.error("Failed to send agent analytics", e); | ||
} finally { | ||
if (connection != null) { | ||
connection.disconnect(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...bly-wsmaster-war/src/main/java/org/eclipse/che/api/deploy/WsMasterAnalyticsAddresser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2016 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.che.api.deploy; | ||
|
||
import org.eclipse.che.commons.schedule.ScheduleRate; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import javax.inject.Singleton; | ||
import javax.net.ssl.HttpsURLConnection; | ||
import java.io.IOException; | ||
import java.net.HttpURLConnection; | ||
import java.net.URL; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Singleton | ||
public class WsMasterAnalyticsAddresser { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(WsMasterAnalyticsAddresser.class); | ||
|
||
@ScheduleRate(period = 1, unit = TimeUnit.HOURS) | ||
void send() { | ||
HttpURLConnection connection = null; | ||
try { | ||
final URL url = new URL("https://install.codenvycorp.com/che/telemetry/master"); | ||
connection = (HttpsURLConnection)url.openConnection(); | ||
connection.getResponseCode(); | ||
} catch (IOException e) { | ||
LOG.error("Failed to send master analytics", e); | ||
} finally { | ||
if (connection != null) { | ||
connection.disconnect(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters