• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

talsma-ict / context-propagation / #1537

08 Nov 2024 09:58AM UTC coverage: 91.953% (+0.3%) from 91.679%
#1537

push

web-flow
Merge 4a83fa71b into 72abd1122

271 of 327 new or added lines in 26 files covered. (82.87%)

857 of 932 relevant lines covered (91.95%)

0.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/context-propagation-core/src/main/java/nl/talsmasoftware/context/core/Timers.java
1
/*
2
 * Copyright 2016-2024 Talsma ICT
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *         http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package nl.talsmasoftware.context.core;
17

18
import nl.talsmasoftware.context.api.ContextTimer;
19

20
import java.util.concurrent.TimeUnit;
21
import java.util.logging.Level;
22
import java.util.logging.Logger;
23

NEW
24
final class Timers {
×
25
    private static final Logger TIMING_LOGGER = Logger.getLogger(Timers.class.getName());
1✔
26

27
    static void timed(long durationNanos, Class<?> type, String method) {
28
        for (ContextTimer delegate : ContextManagers.getContextTimers()) {
1✔
29
            delegate.update(type, method, durationNanos, TimeUnit.NANOSECONDS);
1✔
30
        }
1✔
31
        if (TIMING_LOGGER.isLoggable(Level.FINEST)) {
1✔
NEW
32
            TIMING_LOGGER.log(Level.FINEST, "{0}.{1}: {2,number}ns", new Object[]{type.getName(), method, durationNanos});
×
33
        }
34
    }
1✔
35

36
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc