Skip to content

Commit dc0662e

Browse files
committed
Only monitor external interfaces, and for 1hz
1 parent 5d0d56c commit dc0662e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

NetSpeedMonitor.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381
"$(inherited)",
382382
"@executable_path/../Frameworks",
383383
);
384-
MARKETING_VERSION = 1.1;
384+
MARKETING_VERSION = 1.2;
385385
PRODUCT_BUNDLE_IDENTIFIER = elegracer.NetSpeedMonitor;
386386
PRODUCT_NAME = "$(TARGET_NAME)";
387387
SWIFT_VERSION = 5.0;
@@ -401,7 +401,7 @@
401401
"$(inherited)",
402402
"@executable_path/../Frameworks",
403403
);
404-
MARKETING_VERSION = 1.1;
404+
MARKETING_VERSION = 1.2;
405405
PRODUCT_BUNDLE_IDENTIFIER = elegracer.NetSpeedMonitor;
406406
PRODUCT_NAME = "$(TARGET_NAME)";
407407
SWIFT_VERSION = 5.0;

NetSpeedMonitor/AppDelegate.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
7575
popover.behavior = NSPopover.Behavior.transient
7676
popover.contentViewController = netspeedViewController
7777

78-
timer = Timer.scheduledTimer(withTimeInterval: 2, repeats: true) { timer in
78+
timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { timer in
7979
DispatchQueue.global(qos: .background).async {
8080
let topTask = Process()
8181
topTask.launchPath = "/usr/bin/env"
82-
topTask.arguments = ["nettop", "-d", "-P", "-J", "bytes_in,bytes_out", "-x", "-L", "2", "-c"]
82+
topTask.arguments = ["nettop", "-d", "-P", "-J", "bytes_in,bytes_out", "-x", "-L", "2", "-c", "-t", "external"]
8383

8484
let outpipe = Pipe()
8585
topTask.standardOutput = outpipe

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
Just a minimal menu bar Mac OS X app.
44

5-
It runs `nettop -d -P -J bytes_in,bytes_out -x -L 2 -c` in a repeating timer.
5+
It runs `nettop -d -P -J bytes_in,bytes_out -x -L 2 -c -t external` in a repeating timer.
66

77
Use at your own risk.

0 commit comments

Comments
 (0)