<commit_before># Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package ReportLatency::CGIView;
use parent 'ReportLatency::StaticView';

use strict;
use vars qw($VERSION);

$VERSION     = 0.1;

sub service_img_url {
  my ($self,$service) = @_;

  return "services/$service.png";
}

sub untagged_img_url {
  return "tags/untagged.png";
}

sub tag_img_url {
  my ($self,$tag) = @_;
  return "tags/$tag.png";
}

sub service_url {
  my ($self,$name) = @_;
  return "service?service=$name";
}

sub service_url_from_tag { return service_url(@_); }
sub service_url_from_location { return service_url(@_); }

sub tag_url {
  my ($self,$name) = @_;
  return "tag?name=$name";
}

sub location_url {
  my ($self,$name) = @_;
  return "location?name=$name";
}
sub location_url_from_tag { return location_url(@_); }

1;


=pod

==head1 NAME

ReportLatency::CGIView - ReportLatency CGI view

=head1 VERSION

version 0.1

=head1 SYNOPSIS

use LatencyReport::CGIView

$view = new LatencyReport::CGIView($store);
<commit_msg>fix location image URL in CGIView<commit_after># Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package ReportLatency::CGIView;
use parent 'ReportLatency::StaticView';

use strict;
use vars qw($VERSION);

$VERSION     = 0.1;

sub service_img_url {
  my ($self,$service) = @_;

  return "services/$service.png";
}

sub untagged_img_url {
  return "tags/untagged.png";
}

sub tag_img_url {
  my ($self,$tag) = @_;
  return "tags/$tag.png";
}

sub service_url {
  my ($self,$name) = @_;
  return "service?service=$name";
}

sub service_url_from_tag { return service_url(@_); }
sub service_url_from_location { return service_url(@_); }

sub tag_url {
  my ($self,$name) = @_;
  return "tag?name=$name";
}

sub location_url {
  my ($self,$name) = @_;
  return "location?name=$name";
}
sub location_url_from_tag { return location_url(@_); }

sub location_img_url {
  my ($self,$name) = @_;
  return "locations/$name.png";
}
1;


=pod

==head1 NAME

ReportLatency::CGIView - ReportLatency CGI view

=head1 VERSION

version 0.1

=head1 SYNOPSIS

use LatencyReport::CGIView

$view = new LatencyReport::CGIView($store);

{'fraction_non_alphanumeric': 0.11955168119551682, 'fraction_numerical': 0.009962640099626401, 'mean_word_length': 4.539655172413793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5193524', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1044, 'n_words': 337}