Create new typeDef of MetricsStat to persist Metrics entity.
Create MetricsStat class to keep Metrics' info about collectionTime, metricsId and ttl; create MetricsStatsDTO class to transfer states between MetricsStat and AtlasEntity when it is saved or retrieved from JanusGraph.
Create MetricsStatMin to represent the minimal information about persisted MetricsStat.
Create job scheduler with configurable metrics.persist.schedule (default as 7 days) & metrics.ttl.hours (default as 1 hr interval) to save a metrics entity to db and to sweep through all metrics entities and clear the ones whose time-to-live (ttl) has past.
Update MetricsService to implement REST APIs in AdminResource to realize api calls of:
Get all persisted metricsStats, with boolean variable to choose its return type as a list of metricsStats with specific details, or with minimal information;
Get a specific metricsStat by collectionTime
Update MetricsService to include helper methods of:
Save a metricsStat to db
Get or delete a persisted metricsStat by collectionTime