diff mbox

Change in osmo-pcu[master]: bts/counter: remove trailing white spaces from descriptions

Message ID gerrit.1463500378908.Id852f3671d76a32df903f7a936b348b0d856d9c2@gerrit.osmocom.org
State New
Headers show

Commit Message

gerrit-no-reply@lists.osmocom.org May 17, 2016, 3:52 p.m. UTC
From lynxis lazus <lynxis@fe80.eu>:

lynxis lazus has uploaded a new change for review.

  https://gerrit.osmocom.org/67

Change subject: bts/counter: remove trailing white spaces from descriptions
......................................................................

bts/counter: remove trailing white spaces from descriptions

Change-Id: Id852f3671d76a32df903f7a936b348b0d856d9c2
---
M src/bts.cpp
1 file changed, 29 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/67/1

Comments

gerrit-no-reply@lists.osmocom.org May 17, 2016, 4:01 p.m. UTC | #1
From Holger Freyther <holger@freyther.de>:

Holger Freyther has posted comments on this change.

Change subject: bts/counter: remove trailing white spaces from descriptions
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/67/1//COMMIT_MSG
Commit Message:

Line 7: bts/counter: remove trailing white spaces from descriptions
I think that something like show statistics will now put the ':' all over the place. Can you put the before/after as comment somewhere to ack/nack my statement?
gerrit-no-reply@lists.osmocom.org May 17, 2016, 4:21 p.m. UTC | #2
From Harald Welte <laforge@gnumonks.org>:

Harald Welte has posted comments on this change.

Change subject: bts/counter: remove trailing white spaces from descriptions
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/67/1//COMMIT_MSG
Commit Message:

Line 7: bts/counter: remove trailing white spaces from descriptions
> I think that something like show statistics will now put the ':' all over t
Well, then the counter description/name has been abused by the PCU code so far.  The code that prints the statistics should then do some %20s or other formatting "trick" to do the padding.  Having the padding inside the counter description/name itself looks like a hack to me.
gerrit-no-reply@lists.osmocom.org May 17, 2016, 4:24 p.m. UTC | #3
From Holger Freyther <holger@freyther.de>:

Holger Freyther has posted comments on this change.

Change subject: bts/counter: remove trailing white spaces from descriptions
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/67/1//COMMIT_MSG
Commit Message:

Line 7: bts/counter: remove trailing white spaces from descriptions
> Well, then the counter description/name has been abused by the PCU code so 
Yes, it looks like a hack. But I see the same in gprs_ns.c of libosmocore, gb_proxy.c of OpenBSC/src/gprs and probably more. So let's see if we need the hack and then remove it?
gerrit-no-reply@lists.osmocom.org May 20, 2016, 3:47 p.m. UTC | #4
Patch Set 2: Code-Review-1

ok, then let's postpone this until a change has been made to the code that actually prints those counters.  That change, together with this change will then clean up the code and cancel their effects in terms of formatting
gerrit-no-reply@lists.osmocom.org May 20, 2016, 4:24 p.m. UTC | #5
Patch Set 2:

I have verified that the missing spaces makes the layout look "worse".

Osmo-PCU> show stats 
Ungrouped counters:
BTS Statistics:
 TBF DL Allocated:        0 (0/s 0/m 0/h 0/d)
 TBF DL Freed:        0 (0/s 0/m 0/h 0/d)
 TBF DL Aborted:        0 (0/s 0/m 0/h 0/d)
 TBF UL Allocated:        0 (0/s 0/m 0/h 0/d)
 TBF UL Freed:        0 (0/s 0/m 0/h 0/d)
 TBF UL Aborted:        0 (0/s 0/m 0/h 0/d)
 TBF Reused:        0 (0/s 0/m 0/h 0/d)
 TBF Alloc Algo A:        0 (0/s 0/m 0/h 0/d)
 TBF Alloc Algo B:        0 (0/s 0/m 0/h 0/d)
 TBF Failed EGPRS-only:        0 (0/s 0/m 0/h 0/d)
 RLC Sent:        0 (0/s 0/m 0/h 0/d)
 RLC Resent:        0 (0/s 0/m 0/h 0/d)
 RLC Restarted:        0 (0/s 0/m 0/h 0/d)
 RLC Stalled:        0 (0/s 0/m 0/h 0/d)
 RLC Nacked:        0 (0/s 0/m 0/h 0/d)
 RLC Assign Timeout:        0 (0/s 0/m 0/h 0/d)
 RLC Assign Failed:        0 (0/s 0/m 0/h 0/d)
 RLC Ack Timeout:        0 (0/s 0/m 0/h 0/d)
 RLC Ack Failed:        0 (0/s 0/m 0/h 0/d)
 RLC Release Timeout:        0 (0/s 0/m 0/h 0/d)
 RLC Late Block:        0 (0/s 0/m 0/h 0/d)
 Decode Errors:        0 (0/s 0/m 0/h 0/d)
 SBA Allocated:        0 (0/s 0/m 0/h 0/d)
 SBA Freed:        0 (0/s 0/m 0/h 0/d)
 SBA Timeout:        0 (0/s 0/m 0/h 0/d)
 Timedout Frames:        0 (0/s 0/m 0/h 0/d)
 Dropped Frames:        0 (0/s 0/m 0/h 0/d)
 Scheduled Frames:        0 (0/s 0/m 0/h 0/d)
 RACH requests:        0 (0/s 0/m 0/h 0/d)
BTS Statistics:
 MS Present:        0
diff mbox

Patch

diff --git a/src/bts.cpp b/src/bts.cpp
index 715fb51..ccc433b 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -50,35 +50,35 @@ 
  * the code below.
  */
 static const struct rate_ctr_desc bts_ctr_description[] = {
-	{ "tbf.dl.alloc",		"TBF DL Allocated     "},
-	{ "tbf.dl.freed",		"TBF DL Freed         "},
-	{ "tbf.dl.aborted",		"TBF DL Aborted       "},
-	{ "tbf.ul.alloc",		"TBF UL Allocated     "},
-	{ "tbf.ul.freed",		"TBF UL Freed         "},
-	{ "tbf.ul.aborted",		"TBF UL Aborted       "},
-	{ "tbf.reused",			"TBF Reused           "},
-	{ "tbf.alloc.algo-a",		"TBF Alloc Algo A     "},
-	{ "tbf.alloc.algo-b",		"TBF Alloc Algo B     "},
+	{ "tbf.dl.alloc",		"TBF DL Allocated"     },
+	{ "tbf.dl.freed",		"TBF DL Freed"         },
+	{ "tbf.dl.aborted",		"TBF DL Aborted"       },
+	{ "tbf.ul.alloc",		"TBF UL Allocated"     },
+	{ "tbf.ul.freed",		"TBF UL Freed"         },
+	{ "tbf.ul.aborted",		"TBF UL Aborted"       },
+	{ "tbf.reused",			"TBF Reused"           },
+	{ "tbf.alloc.algo-a",		"TBF Alloc Algo A"     },
+	{ "tbf.alloc.algo-b",		"TBF Alloc Algo B"     },
 	{ "tbf.failed.egprs-only",	"TBF Failed EGPRS-only"},
-	{ "rlc.sent",			"RLC Sent             "},
-	{ "rlc.resent",			"RLC Resent           "},
-	{ "rlc.restarted",		"RLC Restarted        "},
-	{ "rlc.stalled",		"RLC Stalled          "},
-	{ "rlc.nacked",			"RLC Nacked           "},
-	{ "rlc.ass.timedout",		"RLC Assign Timeout   "},
-	{ "rlc.ass.failed",		"RLC Assign Failed    "},
-	{ "rlc.ack.timedout",		"RLC Ack Timeout      "},
-	{ "rlc.ack.failed",		"RLC Ack Failed       "},
-	{ "rlc.rel.timedout",		"RLC Release Timeout  "},
-	{ "rlc.late-block",		"RLC Late Block       "},
-	{ "decode.errors",		"Decode Errors        "},
-	{ "sba.allocated",		"SBA Allocated        "},
-	{ "sba.freed",			"SBA Freed            "},
-	{ "sba.timedout",		"SBA Timeout          "},
-	{ "llc.timeout",		"Timedout Frames      "},
-	{ "llc.dropped",		"Dropped Frames       "},
-	{ "llc.scheduled",		"Scheduled Frames     "},
-	{ "rach.requests",		"RACH requests        "},
+	{ "rlc.sent",			"RLC Sent"             },
+	{ "rlc.resent",			"RLC Resent"           },
+	{ "rlc.restarted",		"RLC Restarted"        },
+	{ "rlc.stalled",		"RLC Stalled"          },
+	{ "rlc.nacked",			"RLC Nacked"           },
+	{ "rlc.ass.timedout",		"RLC Assign Timeout"   },
+	{ "rlc.ass.failed",		"RLC Assign Failed"    },
+	{ "rlc.ack.timedout",		"RLC Ack Timeout"      },
+	{ "rlc.ack.failed",		"RLC Ack Failed"       },
+	{ "rlc.rel.timedout",		"RLC Release Timeout"  },
+	{ "rlc.late-block",		"RLC Late Block"       },
+	{ "decode.errors",		"Decode Errors"        },
+	{ "sba.allocated",		"SBA Allocated"        },
+	{ "sba.freed",			"SBA Freed"            },
+	{ "sba.timedout",		"SBA Timeout"          },
+	{ "llc.timeout",		"Timedout Frames"      },
+	{ "llc.dropped",		"Dropped Frames"       },
+	{ "llc.scheduled",		"Scheduled Frames"     },
+	{ "rach.requests",		"RACH requests"        },
 };
 
 static const struct rate_ctr_group_desc bts_ctrg_desc = {
@@ -90,7 +90,7 @@ 
 };
 
 static const struct osmo_stat_item_desc bts_stat_item_description[] = {
-	{ "ms.present",		"MS Present           ",
+	{ "ms.present",		"MS Present",
 		OSMO_STAT_ITEM_NO_UNIT, 4, 0},
 };