mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-1865: Change StatsCollector to be a manager so that it can initialize itself at proper run level
This commit is contained in:
parent
6837c58e2b
commit
195a4ee526
|
|
@ -64,6 +64,7 @@ import com.cloud.storage.dao.VolumeDao;
|
|||
import com.cloud.storage.secondary.SecondaryStorageVmManager;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.component.ComponentMethodInterceptable;
|
||||
import com.cloud.utils.component.ManagerBase;
|
||||
import com.cloud.utils.concurrency.NamedThreadFactory;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import com.cloud.vm.UserVmManager;
|
||||
|
|
@ -76,7 +77,7 @@ import com.cloud.vm.dao.UserVmDao;
|
|||
*
|
||||
*/
|
||||
@Component
|
||||
public class StatsCollector implements ComponentMethodInterceptable {
|
||||
public class StatsCollector extends ManagerBase implements ComponentMethodInterceptable {
|
||||
public static final Logger s_logger = Logger.getLogger(StatsCollector.class.getName());
|
||||
|
||||
private static StatsCollector s_instance = null;
|
||||
|
|
@ -120,10 +121,11 @@ public class StatsCollector implements ComponentMethodInterceptable {
|
|||
s_instance = this;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void init(){
|
||||
@Override
|
||||
public boolean start() {
|
||||
init(_configDao.getConfiguration());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void init(Map<String, String> configs) {
|
||||
_executor = Executors.newScheduledThreadPool(3, new NamedThreadFactory("StatsCollector"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue