Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
bca40262
Commit
bca40262
authored
Jun 09, 2018
by
Lemon
Committed by
吴晟 Wu Sheng
Jun 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get more specific OS name (#54)
parent
405ccacc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
GrpcApplicationService.cs
src/SkyWalking.Core/Remote/GrpcApplicationService.cs
+2
-1
PlatformInformation.cs
src/SkyWalking.Core/Utils/PlatformInformation.cs
+29
-0
No files found.
src/SkyWalking.Core/Remote/GrpcApplicationService.cs
View file @
bca40262
...
@@ -30,6 +30,7 @@ using SkyWalking.Context;
...
@@ -30,6 +30,7 @@ using SkyWalking.Context;
using
SkyWalking.Dictionarys
;
using
SkyWalking.Dictionarys
;
using
SkyWalking.Logging
;
using
SkyWalking.Logging
;
using
SkyWalking.NetworkProtocol
;
using
SkyWalking.NetworkProtocol
;
using
SkyWalking.Utils
;
namespace
SkyWalking.Remote
namespace
SkyWalking.Remote
{
{
...
@@ -121,7 +122,7 @@ namespace SkyWalking.Remote
...
@@ -121,7 +122,7 @@ namespace SkyWalking.Remote
var
osInfo
=
new
OSInfo
var
osInfo
=
new
OSInfo
{
{
Hostname
=
hostName
,
Hostname
=
hostName
,
OsName
=
Environment
.
OSVersion
.
ToString
(),
OsName
=
PlatformInformation
.
GetOSName
(),
ProcessNo
=
Process
.
GetCurrentProcess
().
Id
ProcessNo
=
Process
.
GetCurrentProcess
().
Id
};
};
...
...
src/SkyWalking.Core/Utils/PlatformInformation.cs
0 → 100644
View file @
bca40262
using
System.Runtime.InteropServices
;
namespace
SkyWalking.Utils
{
internal
static
class
PlatformInformation
{
private
const
string
OSX
=
"Mac OS X"
;
private
const
string
LINUX
=
"Linux"
;
private
const
string
WINDOWS
=
"Windows"
;
public
static
string
GetOSName
()
{
if
(
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
Windows
))
{
return
WINDOWS
;
}
if
(
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
Linux
))
{
return
LINUX
;
}
if
(
RuntimeInformation
.
IsOSPlatform
(
OSPlatform
.
OSX
))
{
return
OSX
;
}
return
"Unknow"
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment