Search in sources :

Example 1 with SamplingRuleRecord

use of com.amazonaws.services.xray.model.SamplingRuleRecord in project aws-xray-sdk-java by aws.

the class RulePoller method pollRule.

private void pollRule() {
    Instant now = clock.instant();
    logger.info("Polling sampling rules.");
    GetSamplingRulesRequest req = new GetSamplingRulesRequest();
    GetSamplingRulesResult records = client.getSamplingRules(req);
    List<SamplingRule> rules = records.getSamplingRuleRecords().stream().map(SamplingRuleRecord::getSamplingRule).filter(CentralizedRule::isValid).collect(Collectors.toList());
    manifest.putRules(rules, now);
}
Also used : SamplingRuleRecord(com.amazonaws.services.xray.model.SamplingRuleRecord) GetSamplingRulesResult(com.amazonaws.services.xray.model.GetSamplingRulesResult) Instant(java.time.Instant) GetSamplingRulesRequest(com.amazonaws.services.xray.model.GetSamplingRulesRequest) SamplingRule(com.amazonaws.services.xray.model.SamplingRule)

Aggregations

GetSamplingRulesRequest (com.amazonaws.services.xray.model.GetSamplingRulesRequest)1 GetSamplingRulesResult (com.amazonaws.services.xray.model.GetSamplingRulesResult)1 SamplingRule (com.amazonaws.services.xray.model.SamplingRule)1 SamplingRuleRecord (com.amazonaws.services.xray.model.SamplingRuleRecord)1 Instant (java.time.Instant)1