-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OZ-0008] initial code for cache testing
Pointing to https://github.com/node-apn/node-http2/releases/tag/apn-2.1.4 instead of https://github.com/molnarg/node-http2 Because of molnarg/node-http2#247
- Loading branch information
Showing
12 changed files
with
178 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="stylesheet" type="text/css" href="/bootstrap/css/bootstrap.css"> | ||
<link rel="stylesheet" type="text/css" href="/bootstrap/css/bootstrap-theme.css"> | ||
|
||
<link rel="stylesheet" type="text/css" href="css/theme.css"> | ||
|
||
<script type="text/javascript" src="jquery/jquery.js"></script> | ||
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script> | ||
|
||
<script type="text/javascript" src="js/TravelLogs.js"></script> | ||
<script> | ||
// TODO: documentation. | ||
function setUp() { | ||
var application = new TravelLogs(); | ||
$('#submitBtn').on('click', application.clickEventHandler.bind(application)); | ||
} | ||
</script> | ||
</head> | ||
<body onload="setUp()"> | ||
<nav class="navbar navbar-default"> | ||
<div class="container-fluid"> | ||
<!-- Brand and toggle get grouped for better mobile display --> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> | ||
<span class="sr-only">Toggle navigation</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<a class="navbar-brand glyphicon glyphicon-home" href="/">Home</a> | ||
</div> | ||
</div> | ||
</nav> | ||
<div class="page-header"> | ||
<h1>1: Caching Test</h1> | ||
</div> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<div class="panel panel-primary"> | ||
<!-- Default panel contents --> | ||
<div class="panel-heading">Choose Test Scenario</div> | ||
<div class="panel-body"> | ||
<input type="radio" name="quantity" value="1" checked> Fetch <br> | ||
<input type="radio" name="quantity" value="2" checked> Server Push <br> | ||
<button id="submitBtn" class="btn btn-default" type="submit">Fetch Quotations</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-10"> | ||
<div class="panel panel-info"> | ||
<!-- Default panel contents --> | ||
<div class="panel-heading">Travel Blog:</div> | ||
<div id="travel-log" class="list-group"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<nav class="navbar navbar-default navbar-fixed-bottom"> | ||
<div class="container-fluid"> | ||
<span class="navbar-text"> Page Statistics : </span> | ||
<span id="loadtimes" class="navbar-text"></span> | ||
</div> | ||
</nav> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// TODO: documentation. | ||
class Application { | ||
class Quote { | ||
constructor() {} | ||
|
||
clickEventHandler(event) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// TODO: documentation. | ||
class TravelLogs { | ||
constructor() {} | ||
|
||
clickEventHandler(event) { | ||
this.startTime = new Date().getTime(); | ||
//this.count = 0; | ||
this.option = parseInt($('input[name=quantity]:checked').get(0).value); | ||
//for (let i = 0; i < this.option; i++) { | ||
this.fetch(this.option === 2 ? "?serverPush": ""); | ||
//} | ||
} | ||
|
||
fetch(queryParam) { | ||
$("#travel-log").html(''); | ||
$.get( `/travelLogs${queryParam}`, (data) => { | ||
this.createTemplate(data); | ||
this.checkTime(); | ||
}); | ||
} | ||
|
||
checkTime() { | ||
//this.count++; | ||
|
||
//if (this.count === this.option) { | ||
let endDate = new Date().getTime(); | ||
let diff = (endDate - this.startTime) / 1000; | ||
$('#loadtimes').html(`Total Time ~ ${diff} seconds`); | ||
//} | ||
} | ||
|
||
createTemplate(data) { | ||
data.forEach(travelLog => { | ||
let images = ''; | ||
travelLog.images.forEach(image => { | ||
images += ` | ||
<div class="col-md-4"> | ||
<div class="thumbnail"> | ||
<img src="${image.url}"> | ||
</div> | ||
</div> | ||
`; | ||
}) | ||
$("#travel-log").append(` | ||
<div>${travelLog.details}</div> | ||
<div class="row"> | ||
${images} | ||
</div> | ||
`); | ||
}) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters