-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #615 from DataDog/limit-devices
Filter disk, io & network metrics by device
- Loading branch information
Showing
8 changed files
with
465 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ | |
|
||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
FLUSH_LOGGING_PERIOD = 10 | ||
FLUSH_LOGGING_INITIAL = 5 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
Return information about the given platform. | ||
""" | ||
|
||
|
||
import sys | ||
|
||
|
||
class Platform(object): | ||
|
||
@staticmethod | ||
def is_darwin(name=None): | ||
name = name or sys.platform | ||
return 'darwin' in name | ||
|
||
@staticmethod | ||
def is_freebsd(name=None): | ||
name = name or sys.platform | ||
return name.startswith("freebsd") | ||
|
||
@staticmethod | ||
def is_linux(name=None): | ||
name = name or sys.platform | ||
return 'linux' in name | ||
|
||
@staticmethod | ||
def is_bsd(name=None): | ||
""" Return true if this is a BSD like operarting system. """ | ||
name = name or sys.platform | ||
return Platform.is_darwin(name) or Platform.is_freebsd(name) | ||
|
||
@staticmethod | ||
def is_solaris(name=None): | ||
name = name or sys.platform | ||
return name == "sunos5" | ||
|
||
@staticmethod | ||
def is_unix(name=None): | ||
""" Return true if the platform is a unix, False otherwise. """ | ||
name = name or sys.platform | ||
return (Platform.is_darwin() | ||
or Platform.is_linux() | ||
or Platform.is_freebsd() | ||
) | ||
|
Oops, something went wrong.