Commit Graph

56 Commits

Author SHA1 Message Date
Ivan Kozlovic
a87050c546 [FIXED] Check for negative Offset and/or Limit when processing Connz
Ensure that if the offset is negative, it is set to 0. If the limit
is negative, it is set to the default value.

Resolves #491
2017-05-17 12:05:54 -06: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
Derek Collison
ddd1b472e2 Removed need for ignore check on staticcheck, added misspell check 2017-04-21 09:11:28 -07:00
Colin Sullivan
6e9e491c79 Updates for running in a windows container environment.
* Fixes unit tests running in windows containers with the default configuration.
2017-01-09 10:07:24 -07:00
Derek Collison
8fbacaaea1 Cleanup for cluster opts 2016-12-02 14:29:22 -08:00
Derek Collison
61e0b758d7 Updates for Go client rename, update vendor dependencies 2016-11-20 13:15:37 -08:00
Ben Tranter
ad6206078f Fix non-ASCII quotes in HTML
Fixes #304

Changes the non-ASCII curly quotes in the HTML to use the regular ASCII double quotes. Also adds a test to check for the existence of non-ASCII characters in that same HTML.
2016-09-12 11:03:19 -04:00
Ivan Kozlovic
e6039e0a8b [FIXED] Server panic when poll for Varz and others concurrently
Resolves #327
2016-08-16 10:50:49 -06:00
Colin Sullivan
80a504303e Add uptime sort option for connz. 2016-05-24 19:32:06 -06:00
Ivan Kozlovic
7bcb699903 Add /stacksz to monitoring
Allows to get the server's stacks from the monitoring interface.
2016-05-23 14:59:09 -06:00
Derek Collison
a2d03fbf5a flush immediately on creation 2016-05-22 15:04:47 -07:00
Derek Collison
67479ea4cd remove runtime import 2016-05-22 13:50:02 -07:00
Derek Collison
d4d2f5ae5c Fix flapper test 2016-05-22 13:40:50 -07:00
Derek Collison
df02549dc2 Report total subscriptions under /varz 2016-05-16 12:46:30 -07:00
Derek Collison
9e73c1db76 Enable listen address parsing for client, cluster and http, enforce http hosts as separate 2016-05-12 16:47:01 -07:00
Derek Collison
fd27025aa3 Ignore client pings for last connection activity 2016-05-09 09:56:38 -07:00
Ivan Kozlovic
bb81a37cdc Fix flapping test
Introduce sleep when checking activity updates. I had fixed it
originally for Windows and then made it for all platform recently
but only for the publish case. I missed the subscribe test.
2016-04-26 18:14:01 -06:00
Ivan Kozlovic
19ea9c5a60 Add test for Connz Total connections 2016-04-26 18:00:58 -06:00
Colin Sullivan
8a07a02a97 Rename the field to 'total'. 2016-04-26 17:49:09 -06:00
Colin Sullivan
a6dfe88746 Add a live connection count to /connz monitoring. 2016-04-26 17:24:01 -06:00
Ivan Kozlovic
acddee9c4a Fix flapping test 2016-04-22 17:10:33 -06:00
Derek Collison
f23f55518c gosimple fixes 2016-03-31 07:28:40 -07:00
Colin Sullivan
2baac47820 Address issues found by golint.
* No functional changes
* Did not address the ALL_CAPS issues
* Did not modify public APIs and field names.
2016-03-15 15:21:13 -06:00
Ivan Kozlovic
6263c66a40 Fixed code and tests to run on Windows
Mainly tests, but also a fix in route.go to reject a route when the
server is being shutdown.
2016-03-07 18:47:20 -07:00
Derek Collison
49a7f2295a gofmt -s fixes 2016-02-29 22:08:49 -08:00
Ivan Kozlovic
193597dbab Update test that would catch incorrect NumConns
- Updating TestConnzWithOffsetAndLimit() to test for c.NumConns.
This would have caught the issue that was fixed in my previous change.

- Use of variable sortValue set to pair.Val to help readability. No functional change.
2016-02-09 12:40:20 -07:00
Ivan Kozlovic
08b8dd796a Fix test to check Idle instead of relying on client id.
Since client connections are handled in go routines, we don't have a guarantee that the second client's id will be > than the first.
2016-02-08 15:51:41 -07:00
Ivan Kozlovic
ecec51a771 Reduce number of objects require to sort connection in HandleConnz
- Use 'Pair' again, but this time, the key is an int64 that the selected sort field will be casted to.
We therefore have now only one type of sort.
- Check validity of sort string early on.
- Ensure that the ConnInfo's field used by the sort is not the value from 'client', but really the one
that was used for the sort.
- Added a test for sort by Idle time.
2016-02-08 15:40:42 -07:00
Ivan Kozlovic
b6292d6d6d Fix monitor port usage for parallel tests.
Use a different MONITOR_PORT for different test packages.
2016-02-08 09:33:39 -07:00
Derek Collison
c0ba6c291f Default sort by cid for connz 2016-02-05 06:07:44 -08:00
Derek Collison
9702156d72 Connection sort updates
- fix bug that did not update last activity on message delivery
- added sort capabilities for last activity
- avoid extra Reverse by simply changing Less func
2016-02-05 05:49:53 -08:00
Derek Collison
b4a6547a18 report len(ci.subs) 2016-02-04 18:05:50 -08:00
Derek Collison
26185a9722 Support for connection last activity tracking 2016-02-04 17:33:40 -08:00
Ivan Kozlovic
0540df470c Use values from ClientInfo instead of client when returning ConnInfo.
When we are returning ConnInfo, if we use the client's current value, they may be off compared to the values used for the sort.
2016-02-03 22:03:38 -07:00
Derek Collison
6433e55314 bad test conditional 2016-01-09 10:09:05 -08:00
Derek Collison
3af90e454f Track total connections, http request stats 2016-01-09 09:57:04 -08:00
Derek Collison
b0c22e9dfd Track start and uptime per connection 2016-01-09 08:20:24 -08:00
Derek Collison
8393c3c994 Basic INFO for cluster auto-discovery, Addresses #126 2015-12-16 12:36:24 -08:00
Waldemar Quevedo
a1a5a3cf9c Expose name label from client in monitoring endpoint 2015-11-01 17:50:10 -08:00
Waldemar Quevedo
9c7de6902c Add option to sort by pending size 2015-08-22 16:00:27 -07:00
cmfatih
3dc7bc2e70 Fix format 2015-08-15 18:55:02 -04:00
cmfatih
7071a9518d Add TestHandleRoot 2015-08-15 18:52:32 -04:00
cmfatih
2b6b160477 Cleanup 2015-08-15 18:45:39 -04:00
cmfatih
a40489678f Typo 2015-08-15 18:26:59 -04:00
cmfatih
3c513b6a8a Fix format 2015-08-15 18:13:01 -04:00
cmfatih
5cf02d76dc Add tests for content-type 2015-08-15 18:09:47 -04:00
Derek Collison
0e59a4a0f5 make sure offset and limit are sane 2015-08-06 16:45:10 -07:00
Derek Collison
cb47c2e494 fixup for collapsed struct 2015-08-06 01:01:29 -07:00
Derek Collison
0a0f322231 Avoid race condition, optimize locks 2015-08-05 22:31:33 -07:00
Waldemar Quevedo
763baa6cda Return client error in case sort option is incorrect 2015-07-23 02:24:21 +00:00