Skip to content

Commit 4e466ad

Browse files
author
Vladimir Kotal
committed
remove project/stack specific authorization metrics
1 parent 181b571 commit 4e466ad

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/authorization/AuthorizationFramework.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,16 +536,13 @@ private boolean checkAll(HttpServletRequest request, String cache, Nameable enti
536536
lock.readLock().unlock();
537537
}
538538

539+
// Update the timers.
539540
authTimer.record(duration);
540541
if (overallDecision) {
541542
authPositiveTimer.record(duration);
542543
} else {
543544
authNegativeTimer.record(duration);
544545
}
545-
Metrics.getRegistry().timer(String.format("authorization_of_%s", entity.getName())).record(duration);
546-
Metrics.getRegistry()
547-
.timer(String.format("authorization_%s_of_%s", overallDecision ? "positive" : "negative", entity.getName()))
548-
.record(duration);
549546

550547
m.put(entity.getName(), overallDecision);
551548
request.setAttribute(cache, m);

opengrok-indexer/src/main/java/org/opengrok/indexer/authorization/AuthorizationStack.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
*/
2424
package org.opengrok.indexer.authorization;
2525

26-
import java.time.Duration;
27-
import java.time.Instant;
2826
import java.util.ArrayList;
2927
import java.util.List;
3028
import java.util.Locale;
@@ -33,7 +31,6 @@
3331
import java.util.logging.Level;
3432
import java.util.logging.Logger;
3533

36-
import org.opengrok.indexer.Metrics;
3734
import org.opengrok.indexer.configuration.Nameable;
3835
import org.opengrok.indexer.logger.LoggerFactory;
3936

@@ -224,8 +221,6 @@ protected boolean processStack(Nameable entity,
224221
PluginDecisionPredicate pluginPredicate,
225222
PluginSkippingPredicate skippingPredicate) {
226223

227-
Instant start = Instant.now();
228-
229224
boolean overallDecision = true;
230225
for (AuthorizationEntity authEntity : getStack()) {
231226

@@ -283,19 +278,6 @@ protected boolean processStack(Nameable entity,
283278
}
284279
}
285280
}
286-
Duration duration = Duration.between(start, Instant.now());
287-
288-
Metrics.getRegistry()
289-
.timer(String.format("authorization_in_stack_%s_%s", getName(),
290-
overallDecision ? "positive" : "negative"))
291-
.record(duration);
292-
Metrics.getRegistry()
293-
.timer(String.format("authorization_in_stack_%s_%s_of_%s", getName(),
294-
overallDecision ? "positive" : "negative", entity.getName()))
295-
.record(duration);
296-
Metrics.getRegistry()
297-
.timer(String.format("authorization_in_stack_%s_of_%s", getName(), entity.getName()))
298-
.record(duration);
299281

300282
return overallDecision;
301283
}

0 commit comments

Comments
 (0)