cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [1/2] git commit: updated refs/heads/reporter to 2e0642e
Date Wed, 03 Dec 2014 10:31:14 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/reporter 026efd344 -> 2e0642e83


Add current version to report


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c13a247a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c13a247a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c13a247a

Branch: refs/heads/reporter
Commit: c13a247a49142ec1f0cadb9528594560cd540077
Parents: 026efd3
Author: Wido den Hollander <wido@widodh.nl>
Authored: Mon Dec 1 16:15:16 2014 +0100
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Mon Dec 1 16:15:16 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cloudstack/report/UsageReporter.java    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c13a247a/server/src/org/apache/cloudstack/report/UsageReporter.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/report/UsageReporter.java b/server/src/org/apache/cloudstack/report/UsageReporter.java
index e7891e9..ff79a91 100644
--- a/server/src/org/apache/cloudstack/report/UsageReporter.java
+++ b/server/src/org/apache/cloudstack/report/UsageReporter.java
@@ -64,7 +64,7 @@ import com.cloud.utils.component.ComponentMethodInterceptable;
 import com.cloud.utils.concurrency.NamedThreadFactory;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.TransactionLegacy;
-
+import com.cloud.upgrade.dao.VersionDao;
 import com.google.gson.Gson;
 import com.google.common.util.concurrent.AtomicLongMap;
 
@@ -95,6 +95,8 @@ public class UsageReporter extends ManagerBase implements ComponentMethodInterce
     private UserVmDao _userVmDao;
     @Inject
     private VMInstanceDao _vmInstance;
+    @Inject
+    private VersionDao _versionDao;
 
     int usageReportInterval = -1;
 
@@ -129,7 +131,7 @@ public class UsageReporter extends ManagerBase implements ComponentMethodInterce
         uniqueID = getUniqueId();
     }
 
-    private void sendReport(String reportUri, String uniqueID, Map<String, Map> reportMap)
{
+    private void sendReport(String reportUri, String uniqueID, Map<String, Object>
reportMap) {
         Gson gson = new Gson();
         String report = gson.toJson(reportMap);
 
@@ -379,19 +381,24 @@ public class UsageReporter extends ManagerBase implements ComponentMethodInterce
         return instanceMap;
     }
 
+    private String getCurrentVersion() {
+        return _versionDao.getCurrentVersion();
+    }
+
     class UsageCollector extends ManagedContextRunnable {
         @Override
         protected void runInContext() {
             try {
                 s_logger.warn("UsageReporter is running...");
 
-                Map<String, Map> reportMap = new HashMap<String, Map>();
+                Map<String, Object> reportMap = new HashMap<String, Object>();
 
                 reportMap.put("hosts", getHostReport());
                 reportMap.put("clusters", getClusterReport());
                 reportMap.put("primaryStorage", getStoragePoolReport());
                 reportMap.put("zones", getDataCenterReport());
                 reportMap.put("instances", getInstanceReport());
+                reportMap.put("current_version", getCurrentVersion());
 
                 sendReport(reportHost, uniqueID, reportMap);
 


Mime
View raw message