Skip to content

Commit

Permalink
Migrate xray traffic statistics to Metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Nov 13, 2024
1 parent 9d63896 commit 28019dc
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 340 deletions.
9 changes: 6 additions & 3 deletions v2rayN/ServiceLib/Handler/StatisticsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public class StatisticsHandler
private ServerStatItem? _serverStatItem;
private List<ServerStatItem> _lstServerStat;
private Action<ServerSpeedItem>? _updateFunc;
private StatisticsV2rayService? _statisticsV2Ray;
//private StatisticsV2rayService? _statisticsV2Ray;
private StatisticsXrayService? _statisticsXray;
private StatisticsSingboxService? _statisticsSingbox;

public List<ServerStatItem> ServerStat => _lstServerStat;
Expand All @@ -25,15 +26,17 @@ public async Task Init(Config config, Action<ServerSpeedItem> updateFunc)

await InitData();

_statisticsV2Ray = new StatisticsV2rayService(config, UpdateServerStatHandler);
//_statisticsV2Ray = new StatisticsV2rayService(config, UpdateServerStatHandler);
_statisticsXray = new StatisticsXrayService(config, UpdateServerStatHandler);
_statisticsSingbox = new StatisticsSingboxService(config, UpdateServerStatHandler);
}

public void Close()
{
try
{
_statisticsV2Ray?.Close();
//_statisticsV2Ray?.Close();
_statisticsXray?.Close();
_statisticsSingbox?.Close();
}
catch (Exception ex)
Expand Down
Loading

0 comments on commit 28019dc

Please sign in to comment.