+
+=head2 buildglobalmap
+
+ This subroutine looks at the specified commands inputted, and generates
+ a hashref containing two arrays, one for global command keys and one for
+ slab command keys.
+
+=cut
+
+sub buildglobalmap {
+ my $results;
+ my @cmds = split( ' ', $commands );
+ foreach my $cmd (@cmds) {
+ if ( $cmd eq "get" ) {
+ $results->{globalcmds}->{cmd_get} = 1;
+ $results->{globalcmds}->{get_hits} = 1;
+ $results->{globalcmds}->{get_misses} = 1;
+ $results->{slabcmds}->{get_hits} = 1;
+ }
+ elsif ( $cmd eq "set" ) {
+ $results->{globalcmds}->{cmd_set} = 1;
+ $results->{slabcmds}->{cmd_set} = 1;
+ }
+ elsif ( $cmd eq "delete" ) {
+ $results->{globalcmds}->{delete_hits} = 1;
+ $results->{globalcmds}->{delete_misses} = 1;
+ $results->{slabcmds}->{delete_hits} = 1;
+ }
+ elsif ( $cmd eq "incr" ) {
+ $results->{globalcmds}->{incr_hits} = 1;
+ $results->{globalcmds}->{incr_misses} = 1;
+ $results->{slabcmds}->{incr_hits} = 1;
+ }
+ elsif ( $cmd eq "decr" ) {
+ $results->{globalcmds}->{decr_hits} = 1;
+ $results->{globalcmds}->{decr_misses} = 1;
+ $results->{slabcmds}->{decr_hits} = 1;
+ }
+ elsif ( $cmd eq "cas" ) {
+ $results->{globalcmds}->{cas_hits} = 1;
+ $results->{globalcmds}->{cas_misses} = 1;
+ $results->{globalcmds}->{cas_badval} = 1;
+ $results->{slabcmds}->{cas_hits} = 1;
+ $results->{slabcmds}->{cas_badval} = 1;
+ }
+ elsif ( $cmd eq "touch" ) {
+ if ( $stats{version} !~ /^1\.4\.[0-7]$/ ) {
+ $results->{globalcmds}->{cmd_touch} = 1;
+ $results->{globalcmds}->{touch_hits} = 1;
+ $results->{globalcmds}->{touch_misses} = 1;
+ $results->{slabcmds}->{touch_hits} = 1;
+ }
+ }
+ elsif ( $cmd eq "flush" ) {
+ if ( $stats{version} !~ /^1\.4\.[0-7]$/ ) {
+ $results->{globalcmds}->{cmd_flush} = 1;
+ }
+ }
+ else {
+
+ # Do absolutely nothing...
+ }
+ }
+ $results->{globalevics}->{evictions} = 1;
+ $results->{globalevics}->{evicted_nonzero} = 1;
+ $results->{slabevics}->{evicted} = 1;
+ $results->{slabevics}->{evicted_nonzero} = 1;
+ if ( $stats{version} !~ /^1\.4\.[0-2]$/ ) {
+ $results->{globalevics}->{reclaimed} = 1;
+ $results->{slabevics}->{reclaimed} = 1;
+ }
+ return $results;
+}