Kaynağa Gözat

Add profiling resources for #94

George S. Baugh 3 yıl önce
ebeveyn
işleme
438cabed8f
3 değiştirilmiş dosya ile 26 ekleme ve 0 silme
  1. 2 0
      .gitignore
  2. 20 0
      call.pl
  3. 4 0
      profile.sh

+ 2 - 0
.gitignore

@@ -5,6 +5,8 @@ dist/
 www/assets
 data/
 blib/
+nytprof/
+nytprof.out
 pm_to_blib
 pod2htmd.tmp
 fgEmojiPicker.js

+ 20 - 0
call.pl

@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+# Really only useful for profiling read routes, which is all I want it for.
+
+use strict;
+use warnings;
+
+#Grab our custom routes
+use lib 'lib';
+use TCMS;
+
+my %env = (
+    REQUEST_METHOD => $ARGV[0],
+    PATH_INFO      => $ARGV[1],
+    QUERY_STRING   => $ARGV[2],
+);
+
+our $app = \&TCMS::app;
+my $out = $app->(\%env);
+
+print $out->[2][0];

+ 4 - 0
profile.sh

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+perl -MDevel::NYTProf call.pl GET /
+nytprofhtml