소스 검색

Add profiling resources for #94

George S. Baugh 3 년 전
부모
커밋
438cabed8f
3개의 변경된 파일26개의 추가작업 그리고 0개의 파일을 삭제
  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