Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cloud-quote
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
cloud-quote
Commits
eb268b0c
Commit
eb268b0c
authored
Apr 11, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added pystones/sec, fixed graph rounding small numbers
parent
654768dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
29 deletions
+54
-29
gadgets/results.html
gadgets/results.html
+53
-28
tmp/tmp_results.html
tmp/tmp_results.html
+1
-1
No files found.
gadgets/results.html
View file @
eb268b0c
...
...
@@ -24,7 +24,7 @@
/* graph */
#results_list
#graph_container_cell
{
min-height
:
360px
;
padding
:
.25em
;
max-width
:
80%
;
margin
:
2em
auto
;}
#results_list
.jqplot-table-legend
td
{
padding
:
0
.2em
;}
#results_list
.jqplot-table-legend
{
margin
:
0
;}
#results_list
.jqplot-table-legend
{
margin
:
0
;
border
:
0
none
;
}
/* popups */
.ui-collapsible-popup
{
padding
:
0
;}
.ui-collapsible-popup
.ui-collapsible-set-horizontal
.ui-collapsible-content
{
margin-top
:
-15px
;
border
:
0
none
;
padding
:
0
;}
...
...
@@ -102,6 +102,7 @@
<select
data-theme=
"f"
id=
"form_results_sort"
name=
"form_results_sort"
>
<option
value=
"sort_provider_az"
data-i18n=
"results.sort.az"
selected=
"selected"
data-placeholder=
"true"
>
Provider A>Z
</option>
<option
value=
"sort_provider_za"
data-i18n=
"results.sort.za"
>
Provider Z>A
</option>
<!-- Doesn't work yet, because data is not kept in same JIO -->
<!--
<option value="sort_price_highest" data-i18n="results.sort.highest_price">Highest Price</option>
<option value="sort_price_lowest" data-i18n="results.sort.lowest_price">Lowest Price</option>
...
...
@@ -156,6 +157,7 @@
(
function
()
{
var
timer
=
null
,
stored_regex
=
{
// TODO: waste of RegExp, albeit... used on every table upload, so better cache here
re_href
:
new
RegExp
(
"
tmp_href
"
,
"
g
"
),
// link to provider
re_title
:
new
RegExp
(
"
tmp_title
"
,
"
g
"
),
// text info for link to provider
re_img_path
:
new
RegExp
(
"
tmp_image_path
"
,
"
g
"
),
// path to logo of provider
...
...
@@ -169,7 +171,8 @@
re_currency
:
new
RegExp
(
"
tmp_currency
"
,
"
g
"
),
// currency of quotation (hardcoded $)
re_py
:
new
RegExp
(
"
tmp_pystone
"
,
"
g
"
),
// lookup pystone average
re_sql
:
new
RegExp
(
"
tmp_sqlbench
"
,
"
g
"
),
// lookup sqlbench average
re_unit
:
new
RegExp
(
"
tmp_unit
"
,
"
g
"
)
// performance units
re_unit_py
:
new
RegExp
(
"
tmp_unit_py
"
,
"
g
"
),
// performance units pystone
re_unit_sql
:
new
RegExp
(
"
tmp_unit_sql
"
,
"
g
"
)
// performance units sqlbench
},
getParameterByName
=
function
(
name
)
{
...
...
@@ -326,17 +329,27 @@
machine_performance
=
{
_id
:
machine_id
,
pystone
:
{
min
:
m
[
"
pystone
"
][
"
min
"
],
avg
:
m
[
"
pystone
"
][
"
avg
"
],
max
:
m
[
"
pystone
"
][
"
max
"
]
time
:
{
min
:
m
[
"
pystone
"
][
"
time
"
][
"
min
"
],
avg
:
m
[
"
pystone
"
][
"
time
"
][
"
avg
"
],
max
:
m
[
"
pystone
"
][
"
time
"
][
"
max
"
]
},
score
:
{
min
:
m
[
"
pystone
"
][
"
score
"
][
"
min
"
],
avg
:
m
[
"
pystone
"
][
"
score
"
][
"
avg
"
],
max
:
m
[
"
pystone
"
][
"
score
"
][
"
max
"
]
}
},
sqlbench
:
{
min
:
m
[
"
sqlbench
"
][
"
min
"
],
avg
:
m
[
"
sqlbench
"
][
"
avg
"
],
max
:
m
[
"
sqlbench
"
][
"
max
"
]
time
:
{
min
:
m
[
"
sqlbench
"
][
"
time
"
][
"
min
"
],
avg
:
m
[
"
sqlbench
"
][
"
time
"
][
"
avg
"
],
max
:
m
[
"
sqlbench
"
][
"
time
"
][
"
max
"
]
}
}
};
$
.
fn
.
fauna
.
performance_avgs
[
machine_id
]
=
[
m
[
"
pystone
"
][
"
avg
"
],
m
[
"
sqlbench
"
][
"
avg
"
]];
// table will show pystone score and sqlbench time!
$
.
fn
.
fauna
.
performance_avgs
[
machine_id
]
=
[
m
[
"
pystone
"
][
"
score
"
][
"
avg
"
],
m
[
"
sqlbench
"
][
"
time
"
][
"
avg
"
]];
$
.
fn
.
fauna
.
jio_performance_details
.
put
(
machine_performance
);
}
};
...
...
@@ -380,10 +393,11 @@
}
};
//
this is becoming to complex,
TODO: simplify!!!
// TODO: simplify!!!
// ================== Complex Query Builder =================
if
(
$
.
fn
.
fauna
.
formdata
!==
""
||
provider_filter
===
"
all
"
)
{
// loop reference
// construct search term from selected criteria
references
=
getObjectSize
(
$
.
fn
.
fauna
.
references
);
for
(
i
in
$
.
fn
.
fauna
.
references
)
{
if
(
$
.
fn
.
fauna
.
references
.
hasOwnProperty
(
i
))
{
...
...
@@ -408,6 +422,7 @@
$
(
'
.search_criteria
'
).
text
();
}
// filter - look up all fields and custom-made searchtext
if
(
search_term
)
{
sort_string
=
"
percentile: = %
"
+
search_term
+
...
...
@@ -422,7 +437,7 @@
}
}
else
{
// we might be switching view from a provider filter_value
// if so, don't load full result set, only provider
// if so, don't load full result set, only
selected
provider
if
(
provider_filter
!==
"
default
"
&&
provider_filter
!==
null
&&
provider_filter
!==
"
all
"
)
{
...
...
@@ -433,15 +448,15 @@
}
}
//
put all strings together
//
concat all search strings
if
(
$
.
fn
.
fauna
.
formdata
!==
""
||
sort_string
!==
""
||
query_string
!==
""
)
{
query_object
.
query
.
query
=
query_string
+
sort_string
;
// deeplink safety
// deeplink safety
(if deeplinking to results, clean the query string)
if
(
query_object
.
query
.
query
===
""
)
{
delete
query_object
.
query
.
query
;
}
}
// ================== /DONE/ =================
// ================== /
QUERY
DONE/ =================
$
.
fn
.
util
.
spin
(
'
show
'
);
...
...
@@ -451,6 +466,7 @@
function
(
err
,
response
){
var
table_target
=
$
(
"
.rendered_result_wrapper
"
),
plot1
;
// switch between table and graph
// make a table
if
(
$
(
"
#form_results_view
"
).
val
()
===
"
display_list
"
)
{
...
...
@@ -490,6 +506,8 @@
for
(
i
=
0
;
i
<
response
.
length
;
i
+=
1
)
{
entry
=
response
[
i
];
machine_currency
=
"
$
"
;
machine_py_unit
=
"
p/s
"
;
machine_sql_unit
=
"
s
"
;
machine_price
=
$
.
fn
.
fauna
.
pricing
[
entry
[
"
_id
"
]]
if
(
entry
[
"
provider
"
]
!==
""
)
{
...
...
@@ -508,9 +526,11 @@
machine_py
=
"
n/a
"
;
machine_sql
=
"
n/a
"
;
machine_performance_unit
=
""
;
machine_py_unit
=
""
;
machine_sql_unit
=
""
;
}
else
{
machine_py
=
$
.
fn
.
fauna
.
performance_avgs
[
entry
[
"
_id
"
]][
0
].
toFixed
(
2
);
machine_sql
=
$
.
fn
.
fauna
.
performance_avgs
[
entry
[
"
_id
"
]][
1
].
toFixed
(
2
);
machine_py
=
$
.
fn
.
fauna
.
performance_avgs
[
entry
[
"
_id
"
]][
0
].
toFixed
(
0
);
machine_sql
=
$
.
fn
.
fauna
.
performance_avgs
[
entry
[
"
_id
"
]][
1
].
toFixed
(
0
);
}
if
(
$
.
fn
.
fauna
.
pricing
[
entry
[
"
_id
"
]]
===
0
||
$
.
fn
.
fauna
.
pricing
[
entry
[
"
_id
"
]]
===
undefined
)
{
...
...
@@ -531,7 +551,8 @@
.
replace
(
stored_regex
.
re_currency
,
machine_currency
)
.
replace
(
stored_regex
.
re_py
,
machine_py
)
.
replace
(
stored_regex
.
re_sql
,
machine_sql
)
.
replace
(
stored_regex
.
re_unit
,
machine_performance_unit
);
.
replace
(
stored_regex
.
re_unit_py
,
machine_py_unit
)
.
replace
(
stored_regex
.
re_unit_sql
,
machine_sql_unit
);
allRows
+=
instance
;
machine_name
=
""
;
...
...
@@ -581,7 +602,7 @@
plotLables
=
[],
// TODO: make this generic
toggle_inputs
=
$
(
"
#results_table-popup input
"
),
toggle_label
toggle_label
,
i
,
j
;
...
...
@@ -590,7 +611,8 @@
entry
=
response
[
i
];
if
(
entry
[
"
provider
"
]
!==
""
)
{
series_providers
.
push
(
entry
[
"
provider
"
]);
series_availability
.
push
(
roundNumber
(
entry
[
"
percentile
"
]
/
100
)
)
series_availability
.
push
(
roundNumber
(
entry
[
"
percentile
"
]
/
100
)
);
series_cost
.
push
(
$
.
fn
.
fauna
.
pricing
[
entry
[
"
_id
"
]]
||
entry
[
"
cost
"
]
||
0
);
// we could jio.get, but it takes to long to create an array
...
...
@@ -636,7 +658,7 @@
.
append
(
$
(
'
<tr><td colspan="5"><div id="graph_container_cell"></div></td></tr>
'
)
)
plotOpts
=
{
title
:
'
Performance
(s) vs Uptime (%), Cost ($/h)
'
,
title
:
'
Performance
vs Uptime, Cost
'
,
seriesDefaults
:{
renderer
:
$
.
jqplot
.
BarRenderer
,
rendererOptions
:{
/* varyBarColor : true,*/
barWidth
:
useBarWidth
}
...
...
@@ -658,7 +680,7 @@
xaxis
:
config_xaxis
,
yaxis
:{
label
:
''
,
renderer
:
$
.
jqplot
.
LogAxisRenderer
renderer
:
$
.
jqplot
.
LogAxisRenderer
,
// rendererOptions: { tickDistribution: "power" },
// max: 1200,
// renderer: $.jqplot.CategoryAxisRenderer,
...
...
@@ -669,7 +691,10 @@
// autoscale: true
},
y2axis
:{
label
:
''
label
:
''
,
tickOptions
:
{
formatString
:
'
%.3f
'
}
// renderer: $.jqplot.CategoryAxisRenderer,
//btickSpacing: 50,
// min: 0,
...
...
@@ -693,32 +718,32 @@
// y-axis - only add series, if columntoggle is checked
// needs to be set after defining object to update accordingly
// TODO: not generic.. redo...
// TODO:
this is
not generic.. redo...
for
(
i
=
0
;
i
<
toggle_inputs
.
length
;
i
+=
1
)
{
if
(
toggle_inputs
[
i
].
checked
)
{
switch
(
i
)
{
case
2
:
// 0-1
plotSeries
.
push
(
series_availability
);
plotLables
.
push
(
"
Availability
"
);
plotLables
.
push
(
"
Availability
(%)
"
);
series_colors
.
push
(
makeColors
(
series_availability
,
"
max
"
,
"
norm
"
));
break
;
case
3
:
// 0-5
plotSeries
.
push
(
series_py
);
plotLables
.
push
(
"
PyStone
"
);
plotLables
.
push
(
"
PyStone
(p/s)
"
);
series_colors
.
push
(
makeColors
(
series_py
,
"
min
"
,
"
log
"
));
break
;
case
4
:
// 0-700
plotSeries
.
push
(
series_sql
);
plotLables
.
push
(
"
SQLBench
"
);
plotLables
.
push
(
"
SQLBench
(s)
"
);
series_colors
.
push
(
makeColors
(
series_sql
,
"
min
"
,
"
log
"
));
break
;
case
5
:
// 0-1
plotSeries
.
push
(
series_cost
);
plotLables
.
push
(
"
Cost
"
);
plotLables
.
push
(
"
Cost
($/h)
"
);
series_colors
.
push
(
makeColors
(
series_cost
,
"
min
"
,
"
norm
"
));
break
;
}
...
...
tmp/tmp_results.html
View file @
eb268b0c
...
...
@@ -8,7 +8,7 @@
</head>
<body>
<table>
<!-- tmp_result_row start -->
<tr
id=
"tmp_result_row"
><td><a
href=
"#"
title=
"tmp_title"
><span
class=
"image_wrapper"
><img
src=
"tmp_image_path"
alt=
"tmp_alias"
></span></a><h2
class=
"provider_name small"
>
tmp_alias
</h2></td><td><span
class=
"key regular"
>
tmp_name
</span></td><td><span
class=
"key regular key_availability"
>
tmp_percentile
%
</span></td><td><span
class=
"key regular key_pystone"
>
tmp_pystonetmp_unit
</span></td><td><span
class=
"key regular key_sql"
>
tmp_sqlbenchtmp_unit
</span></td><td><span
class=
"key regular key_cost"
>
tmp_price
tmp_currency
</span></td><td><a
data-position-to=
"window"
class=
"t scale-a popup_trigger"
href=
"#provider_details"
data-reference=
"tmp_comp"
data-rel=
"popup"
data-role=
"button"
data-theme=
"c"
data-icon=
"info"
data-inline=
"true"
data-i18n-target=
".ui-btn-text"
data-i18n=
"[title]gen.details_info;gen.details"
>
Details
</a></td></td></tr>
<!-- tmp_result_row end -->
<!-- tmp_result_row start -->
<tr
id=
"tmp_result_row"
><td><a
href=
"#"
title=
"tmp_title"
><span
class=
"image_wrapper"
><img
src=
"tmp_image_path"
alt=
"tmp_alias"
></span></a><h2
class=
"provider_name small"
>
tmp_alias
</h2></td><td><span
class=
"key regular"
>
tmp_name
</span></td><td><span
class=
"key regular key_availability"
>
tmp_percentile
%
</span></td><td><span
class=
"key regular key_pystone"
>
tmp_pystonetmp_unit
_py
</span></td><td><span
class=
"key regular key_sql"
>
tmp_sqlbenchtmp_unit_sql
</span></td><td><span
class=
"key regular key_cost"
>
tmp_price
tmp_currency
</span></td><td><a
data-position-to=
"window"
class=
"t scale-a popup_trigger"
href=
"#provider_details"
data-reference=
"tmp_comp"
data-rel=
"popup"
data-role=
"button"
data-theme=
"c"
data-icon=
"info"
data-inline=
"true"
data-i18n-target=
".ui-btn-text"
data-i18n=
"[title]gen.details_info;gen.details"
>
Details
</a></td></td></tr>
<!-- tmp_result_row end -->
<!--
<tr>
<td>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment