cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chipchild...@apache.org
Subject git commit: refs/heads/4.1 - CLOUDSTACK-1738 : Adding code for StatsCollector initialization using spring framework. This was not initialized and hence stats were not colleced on vm, host and storage in CS.
Date Wed, 20 Mar 2013 15:48:04 GMT
Updated Branches:
  refs/heads/4.1 65cc29734 -> cfff6708f


CLOUDSTACK-1738 : Adding code for StatsCollector initialization using spring framework. This
was not initialized and hence stats were not colleced on vm, host and storage in CS.


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

Branch: refs/heads/4.1
Commit: cfff6708f35cfbe3a8f8a61b854b8043942d5b4c
Parents: 65cc297
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Wed Mar 20 15:00:22 2013 +0530
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Wed Mar 20 15:44:22 2013 +0000

----------------------------------------------------------------------
 server/src/com/cloud/server/StatsCollector.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cfff6708/server/src/com/cloud/server/StatsCollector.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index be83c18..6546044 100755
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -27,8 +27,10 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
+import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.resource.ResourceManager;
 
 import org.apache.log4j.Logger;
@@ -89,6 +91,7 @@ public class StatsCollector {
 	@Inject private StoragePoolHostDao _storagePoolHostDao;
 	@Inject private SecondaryStorageVmManager _ssvmMgr;
 	@Inject private ResourceManager _resourceMgr;
+    @Inject private ConfigurationDao _configDao;
 
 	private ConcurrentHashMap<Long, HostStats> _hostStats = new ConcurrentHashMap<Long,
HostStats>();
 	private final ConcurrentHashMap<Long, VmStats> _VmStats = new ConcurrentHashMap<Long,
VmStats>();
@@ -108,6 +111,7 @@ public class StatsCollector {
     }
     
 	public static StatsCollector getInstance(Map<String, String> configs) {
+        s_instance.init(configs);
         return s_instance;
     }
 	
@@ -115,6 +119,11 @@ public class StatsCollector {
 		s_instance = this;
 	}
 
+    @PostConstruct
+    private void init(){
+        init(_configDao.getConfiguration());
+    }
+
 	private void init(Map<String, String> configs) {
 		_executor = Executors.newScheduledThreadPool(3, new NamedThreadFactory("StatsCollector"));
 


Mime
View raw message