cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject git commit: refs/heads/master - 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 11:17:43 GMT
Updated Branches:
  refs/heads/master 873ec2713 -> 3e68dd810


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/3e68dd81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/3e68dd81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/3e68dd81

Branch: refs/heads/master
Commit: 3e68dd810e0d4df5213dd921f4b703befec55ecd
Parents: 873ec27
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Wed Mar 20 16:44:44 2013 +0530
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Wed Mar 20 16:44:44 2013 +0530

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


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3e68dd81/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 76bae5b..7dcf091 100755
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -27,10 +27,15 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
+import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+
+import com.cloud.configuration.dao.ConfigurationDao;
+import com.cloud.resource.ResourceManager;
+
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -88,6 +93,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>();
@@ -107,6 +113,7 @@ public class StatsCollector {
     }
     
 	public static StatsCollector getInstance(Map<String, String> configs) {
+        s_instance.init(configs);
         return s_instance;
     }
 	
@@ -114,6 +121,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