xacml-dpd statistics
Has this XacmlPdpStatisticsManager class with the counter/update actions
private static XacmlPdpStatisticsManager current object is never used, only setted.
public class XacmlPdpStatisticsManager { @Getter @Setter private static XacmlPdpStatisticsManager current = null; private long totalPolicyTypesCount; private long totalPoliciesCount; private long errorsCount; private long permitDecisionsCount; private long denyDecisionsCount; private long indeterminantDecisionsCount; private long notApplicableDecisionsCount; }
drools-pdp
Uses the PolicyStats class to have the numbers but for policy execution
public class PolicyStats { private static final Logger logger = getLogger(PolicyStats.class); /** * Number of executed policy transactions. */ private long policyExecutedCount; /** * Number of successfully executed policy transactions. */ private long policyExecutedSuccessCount; /** * Number of failed executions of policy transactions. */ private long policyExecutedFailCount; /** * Last time the policy transaction was executed. */ private long lastExecutionTime; /** * Average execution time of a policy transaction. */ private double averageExecutionTime; /** * Total policy execution times. */ private double totalElapsedTime; /** * Uptime of the entity holding the stats. */ private long birthTime = Instant.now().toEpochMilli(); /** * Time last transaction was started. */ private long lastStart; }
pap
public class PapStatisticsManager { private final AtomicLong totalPdpCount = new AtomicLong(0); private final AtomicLong totalPdpGroupCount = new AtomicLong(0); private final AtomicLong totalPolicyDeployCount = new AtomicLong(0); private final AtomicLong policyDeploySuccessCount = new AtomicLong(0); private final AtomicLong policyDeployFailureCount = new AtomicLong(0); private final AtomicLong totalPolicyDownloadCount = new AtomicLong(0); private final AtomicLong policyDownloadSuccessCount = new AtomicLong(0); private final AtomicLong policyDownloadFailureCount = new AtomicLong(0); }
apex-pdp
public class ApexPolicyStatisticsManager { private static final Logger LOGGER = LoggerFactory.getLogger(ApexPolicyStatisticsManager.class); public static final String REG_APEX_PDP_POLICY_COUNTER = "object:pdp/statistics/policy/counter"; private final AtomicLong policyDeployCount = new AtomicLong(0); private final AtomicLong policyDeploySuccessCount = new AtomicLong(0); private final AtomicLong policyDeployFailCount = new AtomicLong(0); private final AtomicLong policyExecutedCount = new AtomicLong(0); private final AtomicLong policyExecutedSuccessCount = new AtomicLong(0); private final AtomicLong policyExecutedFailCount = new AtomicLong(0); }
deploy count is updated on message handler method startApexEngine, startApexEngineBasedOnPolicies
policies to undeploy are mentioned on startApexEngineBasedOnPolicies and stopApexEngineBasedOnPolicies
should we update the count on the mentioned methods for when there's a list of policies to undeploy?
private PdpResponseDetails startApexEngineBasedOnPolicies(final PdpUpdate pdpUpdateMsg, final PdpMessageHandler pdpMessageHandler, ApexEngineHandler apexEngineHandler)
Questions:
- all the mentioned classes track different operations?
- can we have one class with common counters then add the extra?
- are they all converging to Pdp Statistics entity?
Proposed solution
- create a class with deploy/undeploy fields
- an object of this class will be added to the ones counting deployments actions
- that way, classes not using those counters won't be affected.
more to come