Révision 17f78427
Whitespace cleanup
- remove trailing whitespace
- remove empty lines at the end of files
| plugins/solr/solr4_ | ||
|---|---|---|
| 1 | 1 |
#!/usr/bin/env python |
| 2 | 2 |
# |
| 3 | 3 |
# Copyright (c) 2013, Antonio Verni, me.verni@gmail.com |
| 4 |
#
|
|
| 4 |
# |
|
| 5 | 5 |
# Permission is hereby granted, free of charge, to any person obtaining a |
| 6 | 6 |
# copy of this software and associated documentation files (the "Software"), |
| 7 | 7 |
# to deal in the Software without restriction, including without limitation |
| ... | ... | |
| 32 | 32 |
# |
| 33 | 33 |
# Example: |
| 34 | 34 |
# [solr_*] |
| 35 |
# env.host_port solrhost:8080
|
|
| 35 |
# env.host_port solrhost:8080 |
|
| 36 | 36 |
# env.url /solr |
| 37 | 37 |
# env.qpshandler_select /select |
| 38 | 38 |
# |
| ... | ... | |
| 301 | 301 |
docs.label Docs |
| 302 | 302 |
graph_category search""" |
| 303 | 303 |
|
| 304 |
INDEXSIZE_GRAPH_TPL = """graph_args --base 1024 -l 0
|
|
| 304 |
INDEXSIZE_GRAPH_TPL = """graph_args --base 1024 -l 0 |
|
| 305 | 305 |
graph_vlabel Bytes |
| 306 | 306 |
graph_title Index Size |
| 307 | 307 |
graph_category search |
| ... | ... | |
| 313 | 313 |
""" |
| 314 | 314 |
|
| 315 | 315 |
INDEXSIZECORE_GRAPH_TPL = """{core}.label {core}
|
| 316 |
{core}.draw STACK"""
|
|
| 316 |
{core}.draw STACK"""
|
|
| 317 | 317 |
|
| 318 | 318 |
MEMORYUSAGE_GRAPH_TPL = """graph_args --base 1024 -l 0 --upper-limit {availableram}
|
| 319 | 319 |
graph_vlabel Bytes |
| ... | ... | |
| 387 | 387 |
cores = self._getCores() |
| 388 | 388 |
graph = [QPSCORE_GRAPH_TPL.format(core=c, gtype='LINESTACK1') for pos,c in enumerate(cores) ] |
| 389 | 389 |
return QPSMAIN_GRAPH_TPL.format( |
| 390 |
cores_qps_graphs='\n'.join(graph),
|
|
| 391 |
handler=self.params['params']['handler'],
|
|
| 392 |
core=self.params['core'],
|
|
| 393 |
cores_qps_cdefs='%s,%s' % (','.join(map(lambda x: 'qps_%s' % x, cores)),','.join(['+']*(len(cores)-1))),
|
|
| 390 |
cores_qps_graphs='\n'.join(graph), |
|
| 391 |
handler=self.params['params']['handler'], |
|
| 392 |
core=self.params['core'], |
|
| 393 |
cores_qps_cdefs='%s,%s' % (','.join(map(lambda x: 'qps_%s' % x, cores)),','.join(['+']*(len(cores)-1))),
|
|
| 394 | 394 |
gorder=','.join(cores) |
| 395 | 395 |
) |
| 396 | 396 |
|
| ... | ... | |
| 481 | 481 |
SOLR_HOST_PORT = os.environ.get('host_port', 'localhost:8080').replace('http://', '')
|
| 482 | 482 |
SOLR_URL = os.environ.get('url', '/solr')
|
| 483 | 483 |
if SOLR_URL[0] != '/': |
| 484 |
SOLR_URL = '/' + SOLR_URL
|
|
| 484 |
SOLR_URL = '/' + SOLR_URL |
|
| 485 | 485 |
mb = SolrMuninGraph(SOLR_HOST_PORT, SOLR_URL, params) |
| 486 | 486 |
if hasattr(mb, params['op']): |
| 487 | 487 |
print getattr(mb, params['op'])(params['type']) |
Formats disponibles : Unified diff