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

LearnLib / learnlib / 20198569605

13 Dec 2025 10:10PM UTC coverage: 94.914% (+0.4%) from 94.471%
20198569605

Pull #153

github

web-flow
Merge 6a71fc929 into 879958926
Pull Request #153: Implementation for learning MMLTs, new model for collecting statistics

1823 of 1873 new or added lines in 77 files covered. (97.33%)

1 existing line in 1 file now uncovered.

14258 of 15022 relevant lines covered (94.91%)

1.73 hits per line

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

80.0
/filters/statistics/src/main/java/de/learnlib/filter/statistic/sul/CounterObservableSUL.java
1
/* Copyright (C) 2013-2025 TU Dortmund University
2
 * This file is part of LearnLib <https://learnlib.de>.
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 de.learnlib.filter.statistic.sul;
17

18
import de.learnlib.statistic.Statistics;
19
import de.learnlib.statistic.StatisticsKey;
20
import de.learnlib.statistic.StatisticsService;
21
import de.learnlib.sul.ObservableSUL;
22
import org.checkerframework.checker.nullness.qual.Nullable;
23

24
/**
25
 * Wrapper for a {@link ObservableSUL} that gathers various statistics on queries sent to this SUL.
26
 *
27
 * @param <I>
28
 *         input symbol type
29
 * @param <O>
30
 *         output symbol type
31
 */
32
public class CounterObservableSUL<S, I, O> extends CounterSUL<I, O> implements ObservableSUL<S, I, O> {
33

34
    private final ObservableSUL<S, I, O> delegate;
35

36
    /**
37
     * Convenience constructor for {@link CounterObservableSUL#CounterObservableSUL(ObservableSUL, String)} which uses
38
     * {@code null} as {@code id}.
39
     *
40
     * @param delegate
41
     *         the SUL to delegate calls to
42
     */
43
    public CounterObservableSUL(ObservableSUL<S, I, O> delegate) {
44
        this(delegate, null);
2✔
45
    }
2✔
46

47
    /**
48
     * Constructs a new counter SUL that writes statistical data to a {@link StatisticsService}. The provided {@code id}
49
     * is used to refine the supported {@link StatisticsKey}s and allows for using multiple instances of this class for
50
     * different purposes.
51
     *
52
     * @param delegate
53
     *         the SUL to delegate calls to
54
     * @param id
55
     *         the id used for specialising the statistics keys
56
     */
57
    public CounterObservableSUL(ObservableSUL<S, I, O> delegate, @Nullable String id) {
58
        this(delegate, id, Statistics.getService());
2✔
59
    }
2✔
60

61
    protected CounterObservableSUL(ObservableSUL<S, I, O> delegate, @Nullable String id, StatisticsService statistics) {
62
        super(delegate, id, statistics);
2✔
63
        this.delegate = delegate;
2✔
64
    }
2✔
65

66
    @Override
67
    public ObservableSUL<S, I, O> fork() {
68
        return new CounterObservableSUL<>(this.delegate.fork(), super.id, super.statistics);
2✔
69
    }
70

71
    @Override
72
    public S getState() {
NEW
73
        return this.delegate.getState();
×
74
    }
75

76
    @Override
77
    public boolean deepCopies() {
NEW
78
        return this.delegate.deepCopies();
×
79
    }
80
}
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