-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frontend ui #4
Open
chushao
wants to merge
21
commits into
master
Choose a base branch
from
frontendUI
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Frontend ui #4
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
04ef2a7
Initial memory recording added. checks memery used
chushao 2512538
Testing Memory service
chushao 5e0ab6e
Converting crontime to 1m
chushao 0688fef
Throwing some error logs
chushao d54efec
Changing to series and in synchronous instead of async
chushao dfa0946
Forgot to add require
chushao fb47992
Adding more debug statements
chushao 1782f90
Take out some stuff
chushao cb0765f
Take out some stuff
chushao 727aa83
Adding more debug code
chushao 879e8e6
Adding some more debug code
chushao ec72a93
Changed to file scope
chushao 2b8ebf1
Finished Memory
chushao baa731a
Finished front end UI Graphing and debugging
chushao 5351a36
Last test on heroku
chushao 9ebfd09
Accidentally a few words
chushao 0a8eeb9
Changing environment to Ubuntu VPS
chushao c6dcf5f
Fixed a bug where CPU values were ints but ran string methods
chushao d7f1c2e
Removed Config button
chushao 18d2d0a
Some changes... not enough to refactor, will do so on a new iteration
chushao 0d69a0a
Small update on design docs. Will be read correctly by CouchDB now
chushao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*.py[cod] | ||
|
||
config.coffee | ||
# C extensions | ||
*.so | ||
|
||
|
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,6 +1,5 @@ | ||
app = require './app/main' | ||
http = require 'http' | ||
|
||
server = (http.createServer app).listen process.env.PORT or 43313 | ||
|
||
server = (http.createServer app).listen 80 | ||
console.log "Express server listening on port %d in %s mode", server.address().port, app.settings.env |
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,41 @@ | ||
# Underscore utility | ||
_ = require("underscore") | ||
|
||
# Miso library | ||
Miso = require("miso.dataset") | ||
|
||
# Nano library | ||
nano = require("nano") | ||
|
||
# | ||
# * The Couchdb importer is responsible for fetching data from a CouchDB | ||
# * database. | ||
# * | ||
# * Parameters: | ||
# * options | ||
# * auth - Authentication to the database server | ||
# * host - Address to the database server | ||
# * db - Name of the database | ||
# * query - Query to make to the database | ||
# | ||
Miso.Importers.Couchdb = (options) -> | ||
_.defaults this, options, | ||
auth: "" | ||
host: "" | ||
db: "" | ||
query: "" | ||
|
||
|
||
# Generate the CouchDB url | ||
url = [@auth, @host, @db].join("") | ||
|
||
# Establish a connection | ||
@connection = nano([url, @query and "?" + @query].join("")) | ||
|
||
_.extend Miso.Importers.Couchdb::, | ||
fetch: (options) -> | ||
if _.isFunction(@view) | ||
@view @connection, (err, data) -> | ||
return options.error(err) if err | ||
options.success data.rows | ||
|
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,59 @@ | ||
# Underscore utility | ||
_ = require("underscore") | ||
|
||
# Miso library | ||
Miso = require("miso.dataset") | ||
Miso.Parsers.Couchdb = (data, options) -> | ||
|
||
_.extend Miso.Parsers.Couchdb::, | ||
parse: (rows) -> | ||
columns = undefined | ||
valueIsObject = undefined | ||
data = {} | ||
|
||
# No data to process | ||
unless rows.length | ||
return ( | ||
columns: [] | ||
data: {} | ||
) | ||
|
||
# If doc property is present, use this as the value | ||
if _.isObject(rows[0].doc) | ||
|
||
# Iterate over every row and swap the doc for the value | ||
_.each rows, (row) -> | ||
|
||
# Swap the value for the document | ||
row.value = row.doc | ||
|
||
|
||
# Set columns based off the first row. | ||
if _.isObject(rows[0].value) | ||
columns = _.keys(rows[0].value) | ||
|
||
# Set this flag for assignment later on | ||
valueIsObject = true | ||
|
||
# If the first row is not an object, use key/val | ||
else | ||
columns = ["key", "value"] | ||
|
||
# Ensure each column has an array for data. | ||
_.each columns, (column) -> | ||
data[column] = [] | ||
|
||
|
||
# Iterate over every row and column and insert the data fetched | ||
# correctly. | ||
_.each rows, (row) -> | ||
_.each columns, (column) -> | ||
|
||
# Add to the respective column, if its not an object, use key/val | ||
data[column].push (if valueIsObject then row.value[column] else row[column]) | ||
|
||
|
||
|
||
# Expected format for dataset. | ||
columns: columns | ||
data: data |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to explicitly say
.prototype
just to be clear.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I don't need to use these anymore ever since I switched from miso dataset to google