Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Oct 8, 2024
1 parent 7fc3159 commit eab3659
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public TrackerService(TrackedPeerRepository trackedPeerRepository,
@Transactional
public void updateTrackerMetrics() {
var totalPeers = meterRegistry.gauge("sparkle_tracker_tracking_total_peers", trackedPeerRepository.count());
var uniquePeers = meterRegistry.gauge("sparkle_tracker_tracking_unique_peers", trackedPeerRepository.countDistinctByPeerId());
var uniqueIps = meterRegistry.gauge("sparkle_tracker_tracking_unique_ips", trackedPeerRepository.countDistinctByPeerIp());
var activeTasks = meterRegistry.gauge("sparkle_tracker_tracking_tasks", trackedPeerRepository.countDistinctByTorrentInfoHash());
var uniquePeers = meterRegistry.gauge("sparkle_tracker_tracking_unique_peers", trackedPeerRepository.countDistinctPeerIdBy());
var uniqueIps = meterRegistry.gauge("sparkle_tracker_tracking_unique_ips", trackedPeerRepository.countDistinctPeerIpBy());
var activeTasks = meterRegistry.gauge("sparkle_tracker_tracking_tasks", trackedPeerRepository.countDistinctTorrentInfoHashBy());
var totalTasks = meterRegistry.gauge("sparkle_tracker_tracking_tasks", trackedTaskRepository.count());
log.info("[Tracker 实时] 总Peer: {}, 唯一Peer: {}, 唯一IP: {}, 活动种子: {}, 种子总数: {}", totalPeers, uniquePeers, uniqueIps, activeTasks, totalTasks);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ order by RANDOM() limit ?3

long countByLeftNot(Long left);

long countDistinctByPeerId();
long countDistinctPeerIdBy();

long countDistinctByPeerIp();
long countDistinctPeerIpBy();

long countDistinctByTorrentInfoHash();
long countDistinctTorrentInfoHashBy();

@Query("select count(*) from TrackedPeer t where t.uploaded = 0")
long countUsersWhoDidntUploadAnyData();
Expand Down

0 comments on commit eab3659

Please sign in to comment.