Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.griddynamics.jagger.agent.impl.MonitoringInfoServiceImpl#getSystemInfo needs to be refactored #201

Open
akelepko opened this issue Jun 25, 2013 · 0 comments

Comments

@akelepko
Copy link
Contributor

  1. use EnumMap instead of HashMap for sysInfoStringMap.
  2. split com.griddynamics.jagger.agent.model.SystemInfoCollector#getMemInfo into corresponding methods. Currently the workflow is as follows: org.hyperic.sigar.Mem gathers statistics; statistics are converted to Strings and put to a map; MonitoringInfoServiceImpl reads the map and parses the Strings into doubles, and puts into sysInfoStringMap. The intermediate conversion steps seem to be redundant.
  3. you don't need to create a Thread each tome here:
    final SettableFuture<Map<String, SystemUnderTestInfo>> future = SettableFuture.create();
    jmxThreadPoolExecutor.submit(new Thread() {
    @OverRide
    public void run() {
    future.set(systemUnderTestService.getInfo());
    }
    });
    You need Callable instead.
  4. why would you want to TimeUtils.sleepMillis(JMX_TIMEOUT) after timeout?
  5. SystemUnderTestService statistics are collected effectively synchronously. Consider submitting the task in the beginning of the method
  6. update guava dependency
  7. on ExecutionException you'd rather propagate it's cause. Otherwise, there's little benefit in calling Throwables.propagate(e) as e is always checked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant