Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

JSON returned by /api/nodes contains a duplicate send_bytes key #305

Closed
djcrumple opened this issue Nov 30, 2016 · 9 comments
Closed

JSON returned by /api/nodes contains a duplicate send_bytes key #305

djcrumple opened this issue Nov 30, 2016 · 9 comments

Comments

@djcrumple
Copy link

Found in 3.6.5

The cluster_links returned by /api/nodes contain two send_bytes and two send_byte_details under stats.

"cluster_links": [{
		"peer_addr": "172.16.13.152",
		"peer_port": 64795,
		"sock_addr": "172.16.13.150",
		"sock_port": 25672,
		"stats": {
			"send_bytes": 5141720072,
			"send_bytes_details": {
				"rate": 2049550.2833333334
			},
			"send_bytes": 13631619783,
			"send_bytes_details": {
				"rate": 2262844.4166666665
			}
		},
		"name": "rabbit@RMQTest03"
	}, {
		"peer_addr": "172.16.13.151",
		"peer_port": 64807,
		"sock_addr": "172.16.13.150",
		"sock_port": 25672,
		"stats": {
			"send_bytes": 4107425723,
			"send_bytes_details": {
				"rate": 8040.616666666667
			},
			"send_bytes": 12850589598,
			"send_bytes_details": {
				"rate": 1090.1
			}
		},
		"name": "rabbit@RMQTest02"
	}],
@michaelklishin
Copy link
Member

This is #278. Please upgrade to 3.6.6.

@michaelklishin
Copy link
Member

Or it could be a variation thereof but if we don't have a way to reproduce this against 3.6.6, we can't be sure. Some JSON parsers are more forgiving, so we also need to know what specific library can be used to reproduce.

@djcrumple
Copy link
Author

I believe this is the source of the issue. send_bytes is added to the results twice. Guessing the second one should be recieved_bytes based on context.

format_rate(coarse_node_node_stats, {_, S, R}, {_, TS, TR}, {_, SS, SR},
Factor) ->
Length = length(SS),
[
{send_bytes, TS},
{send_bytes_details, [{rate, apply_factor(S, Factor)},
{samples, SS}] ++ average(SS, Length)},
{send_bytes, TR},
{send_bytes_details, [{rate, apply_factor(R, Factor)},
{samples, SR}] ++ average(SR, Length)}
];

@michaelklishin
Copy link
Member

Yes, and it was introduced in 0b14e72. Looks like a typo indeed.

@michaelklishin
Copy link
Member

With #236 about to be merged this may or may not be relevant for 3.6.7 already. @dcorbacho and @kjnilsson can tell :)

@michaelklishin michaelklishin changed the title Invalid json returned by /api/nodes JSON returned by /api/nodes contains a duplicate send_bytes key Nov 30, 2016
@michaelklishin
Copy link
Member

I also suspect that the field was supposed to be named sent_bytes and not send_bytes.

@dcorbacho
Copy link
Contributor

@michaelklishin
Copy link
Member

@dcorbacho yes, seems to be introduced in dc4a42a :( Alright, let's leave it as is then.

@michaelklishin
Copy link
Member

FTR, this was fixed as part of #236.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants