Class: ladybug::QuerySummary
- Inherits:
-
Object
- Object
- ladybug::QuerySummary
- Defined in:
- ext/ladybug_ext/query_summary.c
Class Method Summary collapse
-
.Ladybug::QuerySummary.from_result(result) ⇒ Object
Return a Ladybug::QuerySummary from a Ladybug::Result.
Instance Method Summary collapse
-
#compiling_time ⇒ Float
Returns the compilation time of the given query summary in milliseconds.
-
#execution_time ⇒ Float
Returns the execution time of the given query summary in milliseconds.
Class Method Details
.Ladybug::QuerySummary.from_result(result) ⇒ Object
Return a Ladybug::QuerySummary from a Ladybug::Result.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'ext/ladybug_ext/query_summary.c', line 57
static VALUE
rlbug_query_summary_s_from_result( VALUE klass, VALUE query_result )
{
rlbug_query_result *result = rlbug_get_result( query_result );
lbug_query_summary *query_summary = ALLOC( lbug_query_summary );
VALUE query_summary_obj = rb_class_new_instance( 0, 0, klass );
/*
TODO Release the GIL
*/
if ( lbug_query_result_get_query_summary(&result->result, query_summary) != LbugSuccess ) {
xfree( query_summary );
query_summary = NULL;
rb_raise( rlbug_eQueryError, "Could not fetch the query summary." );
}
DEBUG_GC( ">>> allocated query summary %p\n", query_summary );
RTYPEDDATA_DATA( query_summary_obj ) = query_summary;
return query_summary_obj;
}
|
Instance Method Details
#compiling_time ⇒ Float
Returns the compilation time of the given query summary in milliseconds.
88 89 90 91 92 93 94 95 |
# File 'ext/ladybug_ext/query_summary.c', line 88
static VALUE
rlbug_query_summary_compiling_time( VALUE self )
{
lbug_query_summary *summary = CHECK_QUERY_SUMMARY( self );
double result = lbug_query_summary_get_compiling_time( summary );
return rb_float_new( result );
}
|
#execution_time ⇒ Float
Returns the execution time of the given query summary in milliseconds.
105 106 107 108 109 110 111 112 |
# File 'ext/ladybug_ext/query_summary.c', line 105
static VALUE
rlbug_query_summary_execution_time( VALUE self )
{
lbug_query_summary *summary = CHECK_QUERY_SUMMARY( self );
double result = lbug_query_summary_get_execution_time( summary );
return rb_float_new( result );
}
|