class JvmSystemPropertiesInfoMetricImporter implements MetricsImporter {

    @Override
    public void register(Registry registry) {
        Id id = registry.createId(LookoutIdNameConstants.JVM_SYSTEM_PROP_NAME);
        registry.info(id, new AutoPollFriendlyInfo<Properties>() {
            @Override
            public AutoPollSuggestion autoPollSuggest() {
                return AutoPollSuggestion.POLL_WHEN_UPDATED;
            }

            @Override
            public long lastModifiedTime() {
                //only report once on startup
                return -1;
            }

            @Override
            public Properties value() {
                return System.getProperties();
            }
        });

        Id envId = registry.createId(LookoutIdNameConstants.JVM_SYSTEM_ENV_NAME);
        registry.info(envId, new AutoPollFriendlyInfo<Map<String, String>>() {
            @Override
            public AutoPollSuggestion autoPollSuggest() {
                return AutoPollSuggestion.POLL_WHEN_UPDATED;
            }

            @Override
            public long lastModifiedTime() {
                //only report once on startup
                return -1;
            }

            @Override
            public Map<String, String> value() {
                return System.getenv();
            }
        });
    }

}