Commit Graph

19 Commits

Author SHA1 Message Date
Derek Collison
361af54f51 Remove external dependency on 'ps' for memory and cpu usage.
Signed-off-by: Derek Collison <derek@nats.io>
2021-06-06 11:13:32 -07:00
Phil Pennock
bc6c433142 FreeBSD fixes: %cpu scale; no-cgo for amd64
It would be convenient if we did not need to use cgo to compile for
FreeBSD for common architectures, allowing builds to be generated in
Linux CI flows.

The sysctl interface uses offsets which can vary by build architecture,
so doing this in the general case without cgo is not realistic.  But we
can front-load the C work to get the offsets for a given architecture,
then use encoding/binary at run-time.

While doing this, I saw that the existing FreeBSD code was
mis-calculating `%cpu` by converting the `fixpt_t` scaled int straight
to a double without dividing by the scaling factor, so we also fix for
all other architectures by introducing a division by `FSCALE`.

The offsets-emitting code is in `freebsd.txt`, with the filename chosen
to keep the Go toolchain from picking it up and trying to compile.

The result is unsafe-free cgo-free builds for FreeBSD/amd64.
2020-11-24 23:04:50 -05:00
Guangming Wang
9a003ba042 fix string trim func usage in pse
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-10-15 23:55:13 +08:00
Derek Collison
6584a9a828 lint updates
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-06 15:41:38 -07:00
Gabriel Guzman
f7f333ed2f Update 2018-03-29 11:48:09 -04:00
Gabriel Guzman
a29b08073e Add pse file for openbsd 2018-03-29 09:41:45 -04:00
Derek Collison
00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Ivan Kozlovic
09f4b85a66 [ADDED] Ability to get the server's HTTP Handler
This will allow applications (for instance NATS Streaming Server)
to add new endpoints to the NATS http server.

Resolves #480
2017-04-27 16:37:01 -06:00
Ivan Kozlovic
d21210e0e9 [FIXED] PS test to reduce failures in some situations
Added garbage collection before each capture method and bump the
delta threshold to 1MB.

Resolves #310
2016-07-18 13:00:49 -06:00
Derek Collison
8558c8e4c5 Merge pull request #300 from nats-io/authorization
Authorization
2016-06-20 09:26:10 -07:00
Derek Collison
fa95bd936b spelling 2016-06-17 10:09:14 -07:00
Ian Eyberg
b5a30be37c . 2016-06-13 10:07:28 -07:00
Ian Eyberg
9d5c5ba1a8 rumprun support 2016-06-13 09:29:40 -07:00
Colin Sullivan
26dab3bf8a Update PSE for Windows
* Call into the performance counter API directly
* Incorporate caching to reduce load on the server
2016-05-05 23:31:05 -06:00
Derek Collison
137c2d0109 Add sampling for pcpu 2016-05-05 13:55:23 -07:00
Colin Sullivan
79b4e6be10 While locally tested, this test wasn't being run with the original enhancement.
* Include the test for windows
* Call ProcUsage (versus procUsage), as test was moved.
2016-05-02 15:25:07 -06:00
Ivan Kozlovic
7a43747107 Remove comment 2016-04-22 07:45:20 -06:00
Ivan Kozlovic
bff3603606 Fix Windows build
Code referenced Debugf which is not available in this package
2016-04-21 18:34:24 -06:00
Derek Collison
5bea74c2ed Rename and move some things around 2016-04-21 09:33:26 -07:00