ladybug::

QuerySummary class

Public Class Methods

Ladybug::QuerySummary.from_result( result ) → query_summary

Return a Ladybug::QuerySummary from a Ladybug::Result.

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;
}

Public Instance Methods

compiling_time → float

Returns the compilation time of the given query summary in milliseconds.

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.

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 );
}