yeg
2026-09-05 92f32acd847ea1700590bc669750f23ef499840e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.battery.business.runtime;
 
import java.time.Instant;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.context.annotation.Profile;
import com.battery.device.simulator.BtsDevelopmentSimulator;
 
/** 按各采集器配置频率推进开发模拟测量,不参与正式测试数据持久化。 */
@Component
@Profile("dev-simulator")
public class DevelopmentCollectorSamplingScheduler
{
    private final BtsDevelopmentSimulator simulator;
 
    public DevelopmentCollectorSamplingScheduler(BtsDevelopmentSimulator simulator)
    {
        this.simulator = simulator;
    }
 
    /** 高频检查只在采样到期时写穿 Redis,采集器之间不要求同频。 */
    @Scheduled(fixedDelay = 100)
    public void sample()
    {
        simulator.advanceCollectors(Instant.now());
    }
}