zeroc-ice / ice-demos

Sample programs for Ice
https://zeroc.com
GNU General Public License v2.0
325 stars 217 forks source link

Error in python Ice/metrics demo #92

Closed bernardnormier closed 5 years ago

bernardnormier commented 5 years ago

I am getting the following on macOS:

$ python2 Metrics.py --Endpoints="tcp -p 10004 -h localhost" --InstanceName="server" dump
View: ByParent

 +=========================+===+=====+======+======+======+========+
 |Threads                  |  #|Total|    IO|  User| Other| Avg (s)|
 +=========================+===+=====+======+======+======+========+
 |Communicator             |  1|    1|     0|     0|     0|   0.000|
 |Ice.ThreadPool.Client    |  1|    1|     0|     0|     0|   0.000|
 |Ice.ThreadPool.Server    |  1|    1|     0|     1|     0|   0.000|
 +=========================+===+=====+======+======+======+========+

 +========================================+===+=====+=====+=====+========+
 |Dispatch                                |  #|Total|   Sz|RepSz|Avg (ms)|
 +========================================+===+=====+=====+=====+========+
 |Ice.Admin                               |  1|   15|  912| 2190|   0.431|
 |IceDiscovery.Locator                    |  0|    2|  251|   97|   1.457|
 +========================================+===+=====+=====+=====+========+

 +===================================+===+=====+==========+==========+========+
 |Connections                        |  #|Total|   RxBytes|   TxBytes| Avg (s)|
 +===================================+===+=====+==========+==========+========+
 |IceDiscovery.Reply                 |  1|    1|         0|         0|   0.000|
 |Ice.Admin                          |  1|    3|      1210|      2442|   0.006|
 |Hello                              |  1|    1|         0|         0|   0.000|
 |IceDiscovery.Multicast             |  1|    1|         0|         0|   0.000|
 +===================================+===+=====+==========+==========+========+

 +=======================================+===+=====+=====+=====+=====+========+
 |Invocations                            |  #|Total| Rtrs|   Sz|RepSz|Avg (ms)|
 +=======================================+===+=====+=====+=====+=====+========+
 |Communicator                           |  0|    2|    0|     |     |   4.335|
Traceback (most recent call last):
  File "Metrics.py", line 329, in <module>
    run(communicator)
  File "Metrics.py", line 287, in run
    printMetricsView(metrics, v, metrics.getMetricsView(v))
  File "Metrics.py", line 229, in printMetricsView
    printMetricsMap(admin, viewName, mapName, map)
  File "Metrics.py", line 195, in printMetricsMap
    printMetrics("Collocated", metricsField(so))
UnboundLocalError: local variable 'so' referenced before assignment

$ python3 Metrics.py --Endpoints="tcp -p 10004 -h localhost" --InstanceName="server" dump
View: ByParent

 +=======================================+===+=====+=====+=====+=====+========+
 |Invocations                            |  #|Total| Rtrs|   Sz|RepSz|Avg (ms)|
 +=======================================+===+=====+=====+=====+=====+========+
 |Communicator                           |  0|    2|    0|     |     |   4.335|
Traceback (most recent call last):
  File "Metrics.py", line 329, in <module>
    run(communicator)
  File "Metrics.py", line 287, in run
    printMetricsView(metrics, v, metrics.getMetricsView(v))
  File "Metrics.py", line 229, in printMetricsView
    printMetricsMap(admin, viewName, mapName, map)
  File "Metrics.py", line 195, in printMetricsMap
    printMetrics("Collocated", metricsField(so))
UnboundLocalError: local variable 'so' referenced before assignment