~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Olaf van der Spek
  • Date: 2011-04-08 12:15:12 UTC
  • mto: (2275.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2276.
  • Revision ID: olafvdspek@gmail.com-20110408121512-a824wng0dy94hbli
Session Times

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
 * session object.
79
79
 */
80
80
 
81
 
class Session_times;
82
 
 
83
81
class DRIZZLED_API Session : public Open_tables_state
84
82
{
85
83
private:
402
400
 
403
401
  session::Transactions& transaction;
404
402
  Open_tables_state& open_tables;
405
 
        Session_times& times;
 
403
        session::Times& times;
406
404
 
407
405
  Field *dup_field;
408
406
  sigset_t signals;
903
901
  void set_time_after_lock();
904
902
  void set_end_timer();
905
903
 
906
 
  uint64_t getElapsedTime() const
907
 
  {
908
 
    return (_end_timer - _start_timer).total_microseconds();
909
 
  }
910
 
 
911
 
  /**
912
 
   * Returns the current micro-timestamp
913
 
   */
914
 
  type::Time::epoch_t getCurrentTimestamp(bool actual= true) const
915
 
  {
916
 
    return ((actual ? boost::posix_time::microsec_clock::universal_time() : _end_timer) - _epoch).total_microseconds();
917
 
  }
918
 
 
919
 
  // We may need to set user on this
920
 
  type::Time::epoch_t getCurrentTimestampEpoch() const
921
 
  {
922
 
                return ((_user_time.is_not_a_date_time() ? _start_timer : _user_time) - _epoch).total_seconds();
923
 
  }
924
 
 
925
 
  type::Time::epoch_t getCurrentTimestampEpoch(type::Time::usec_t &fraction_arg) const
926
 
  {
927
 
    if (not _user_time.is_not_a_date_time())
928
 
    {
929
 
      fraction_arg= 0;
930
 
      return (_user_time - _epoch).total_seconds();
931
 
    }
932
 
 
933
 
    fraction_arg= _start_timer.time_of_day().fractional_seconds() % 1000000;
934
 
    return (_start_timer - _epoch).total_seconds();
935
 
  }
 
904
  uint64_t getElapsedTime() const;
 
905
 
 
906
  type::Time::epoch_t getCurrentTimestamp(bool actual= true) const;
 
907
  type::Time::epoch_t getCurrentTimestampEpoch() const;
 
908
  type::Time::epoch_t getCurrentTimestampEpoch(type::Time::usec_t &fraction_arg) const;
936
909
 
937
910
  uint64_t found_rows() const
938
911
  {