~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/archive_performance.cc

  • Committer: Brian Aker
  • Date: 2009-10-16 10:27:33 UTC
  • mfrom: (1183.1.4 merge)
  • Revision ID: brian@gaz-20091016102733-b10po5oup0hjlilh
MergeĀ EngineĀ changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
 
#include "config.h"
 
16
#include "drizzled/global.h"
17
17
 
18
18
#include "azio.h"
19
19
#include <string.h>
21
21
#include <stdio.h>
22
22
#include <stdlib.h>
23
23
#include <string.h>
24
 
#include <fcntl.h>
25
 
#include <sys/stat.h>
26
 
#include <memory>
 
24
#include <mysys/my_getopt.h>
27
25
 
28
26
#if TIME_WITH_SYS_TIME
29
27
# include <sys/time.h>
36
34
# endif
37
35
#endif
38
36
 
39
 
#include <boost/scoped_ptr.hpp>
40
37
 
41
38
#define TEST_FILENAME "performance_test.az"
42
39
 
57
54
  struct timeval start_time, end_time;
58
55
  long int timing;
59
56
 
60
 
  drizzled::internal::my_init();
 
57
  my_init();
61
58
  MY_INIT(argv[0]);
62
59
 
63
60
  if (argc != 1)
69
66
  for (method= AZ_METHOD_BLOCK; method < AZ_METHOD_MAX; method++)
70
67
  {
71
68
    unsigned int ret;
72
 
    boost::scoped_ptr<azio_stream> reader_handle_ap(new azio_stream);
73
 
    azio_stream &reader_handle= *reader_handle_ap.get();
 
69
    azio_stream reader_handle;
74
70
 
75
71
    if (method)
76
 
      printf("Performing azio_read() test\n");
 
72
      printf("Performing aio_read() test\n");
77
73
    else
78
74
      printf("Performing read() test\n");
79
75
 
93
89
    azclose(&reader_handle);
94
90
  }
95
91
 
96
 
  drizzled::internal::my_end();
 
92
  my_end(0);
97
93
 
98
94
  return 0;
99
95
}
100
96
 
101
97
static int generate_data(uint64_t rows_to_test)
102
98
{
103
 
  boost::scoped_ptr<azio_stream> writer_handle_ap(new azio_stream);
104
 
  azio_stream &writer_handle= *writer_handle_ap.get();
 
99
  azio_stream writer_handle;
105
100
  uint64_t x;
106
101
  unsigned int ret;
107
102
  struct timeval start_time, end_time;