main/src/main/java/org/onap/policy/pap/main/rest/StatisticsProvider.java
/**
     * Returns the current statistics of pap component.
     *
     * @return Report containing statistics of pap component
     */
Returns the current statistics of pap component.
@return Report containing statistics of pap component
Returns the current statistics of pap component . @return Report containing statistics of pap component
public StatisticsReport fetchCurrentStatistics() {
        final StatisticsReport report = new StatisticsReport();
        report.setCode(Registry.get(PapConstants.REG_PAP_ACTIVATOR, PapActivator.class).isAlive() ? 200 : 500);
        PapStatisticsManager mgr = Registry.get(PapConstants.REG_STATISTICS_MANAGER, PapStatisticsManager.class);
        report.setTotalPdpCount(mgr.getTotalPdpCount());
        report.setTotalPdpGroupCount(mgr.getTotalPdpGroupCount());
        report.setTotalPolicyDownloadCount(mgr.getTotalPolicyDownloadCount());
        report.setPolicyDownloadSuccessCount(mgr.getPolicyDownloadSuccessCount());
        report.setPolicyDownloadFailureCount(mgr.getPolicyDownloadFailureCount());
        report.setTotalPolicyDeployCount(mgr.getTotalPolicyDeployCount());
        report.setPolicyDeploySuccessCount(mgr.getPolicyDeploySuccessCount());
        report.setPolicyDeployFailureCount(mgr.getPolicyDeployFailureCount());
        return report;
    }
public StatisticsReport fetchCurrentStatistics ( ) { final StatisticsReport report = new StatisticsReport ( ) ; report . setCode ( Registry . get ( PapConstants . REG_PAP_ACTIVATOR , PapActivator . class ) . isAlive ( ) ? 200 : 500 ) ; PapStatisticsManager mgr = Registry . get ( PapConstants . REG_STATISTICS_MANAGER , PapStatisticsManager . class ) ; report . setTotalPdpCount ( mgr . getTotalPdpCount ( ) ) ; report . setTotalPdpGroupCount ( mgr . getTotalPdpGroupCount ( ) ) ; report . setTotalPolicyDownloadCount ( mgr . getTotalPolicyDownloadCount ( ) ) ; report . setPolicyDownloadSuccessCount ( mgr . getPolicyDownloadSuccessCount ( ) ) ; report . setPolicyDownloadFailureCount ( mgr . getPolicyDownloadFailureCount ( ) ) ; report . setTotalPolicyDeployCount ( mgr . getTotalPolicyDeployCount ( ) ) ; report . setPolicyDeploySuccessCount ( mgr . getPolicyDeploySuccessCount ( ) ) ; report . setPolicyDeployFailureCount ( mgr . getPolicyDeployFailureCount ( ) ) ; return report ; }
Returns the current statistics of pap component.
Returns the current statistics of pap component .