keighrim / cs105_nt Goto Github PK
View Code? Open in Web Editor NEWnanoTwitter project for the final for CS105 (fall 2015)
License: MIT License
nanoTwitter project for the final for CS105 (fall 2015)
License: MIT License
From Pito: Update your schema to put indeces and other enhancements and see the effect on scaling
[LOADTEST] Investigate and choose a way to load test your app. Use loader.io
. Configure your app and heroku
accordingly.
instead it runs unittests
to implement
From Pito: Switch web server from WebBrick; try others, measure.
More for testing and for rest API's.
As a regular Tuesday schedule.
from Tiffany
New class error when running test/follows/1234 (also supposed to be test/follow/1234 just so you know).
Realized that we really want datetime for the column, not just date. Going to change the column to be of type datetime, as well as add in seed data that will generate random times for tweets. Also, when a tweet is made, give it the current time. The ordering also needs to be done by descending, so that the most recent tweets appear first.
[HEROKU] Have Codeship deploy to Heroku. Make sure tests still run.
from Pito: [CLIENTLIBTEST] Write a complete set of tests for your client library demonstrating that the client library indeed works. Again the example is explained early in [SODRR].
Let's see if it help for performance.
When the user is not logged in, it redirect to login/register page.
Implement those API's in our documentation.
App runs fine both on my laptop (linux) and desktop (osx). But I'm not sure what is the problem. Heres logs from heroku logs
2015-11-17T19:43:58.695699+00:00 app[web.1]: 2015-11-17 19:43:58 - NoMethodError - undefined method `name' for nil:NilClass:
2015-11-17T19:43:58.695703+00:00 app[web.1]: /app/views/timeline.erb:51:in `block (2 levels) in singleton class'
2015-11-17T19:43:58.695704+00:00 app[web.1]: /app/views/timeline.erb:50:in `each'
2015-11-17T19:43:58.695705+00:00 app[web.1]: /app/views/timeline.erb:50:in `block in singleton class'
2015-11-17T19:43:58.695706+00:00 app[web.1]: /app/views/timeline.erb:-6:in `instance_eval'
2015-11-17T19:43:58.695706+00:00 app[web.1]: /app/views/timeline.erb:-6:in `singleton class'
2015-11-17T19:43:58.695707+00:00 app[web.1]: /app/views/timeline.erb:-8:in `__tilt_69828649883580'
2015-11-17T19:43:58.695708+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/tilt-2.0.1/lib/tilt/template.rb:155:in `call'
2015-11-17T19:43:58.695710+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/tilt-2.0.1/lib/tilt/template.rb:96:in `render'
2015-11-17T19:43:58.695709+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/tilt-2.0.1/lib/tilt/template.rb:155:in `evaluate'
2015-11-17T19:43:58.695710+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:822:in `render'
2015-11-17T19:43:58.695711+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:666:in `erb'
2015-11-17T19:43:58.695712+00:00 app[web.1]: /app/app.rb:81:in `block in <top (required)>'
2015-11-17T19:43:58.695712+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'
2015-11-17T19:43:58.695713+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'
... (several more lines of trace stack not seemingly relevent)
2015-11-17T19:43:58.695746+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
2015-11-17T19:43:58.696337+00:00 app[web.1]: 129.64.55.161 - - [17/Nov/2015:19:43:58 +0000] "GET /timeline HTTP/1.1" 500 30 0.0117
2015-11-17T19:43:58.695749+00:00 app[web.1]: /app/vendor/bundle/ruby/2.1.0/gems/puma-2.15.3/lib/puma/configuration.rb:79:in `call'
2015-11-17T19:43:58.690381+00:00 app[web.1]: WARN: tilt autoloading 'tilt/erubis' in a non thread-safe way; explicit require 'tilt/erubis' suggested.
2015-11-17T19:43:59.198822+00:00 heroku[router]: at=info method=GET path="/" host=afternoon-peak-6349.herokuapp.com request_id=68034063-61c7-41cc-8e84-2305bfb184f7 fwd="129.64.55.161" dyno=web.1 connect=5ms service=4ms status=302 bytes=768
2015-11-17T19:43:59.198630+00:00 app[web.1]: 129.64.55.161 - - [17/Nov/2015:19:43:59 +0000] "GET / HTTP/1.1" 302 - 0.0020
75 get '/timeline' do
76 if session[:logged_in_user_name].nil?
77 @tweets = Tweet.all.order(tweeted_at: :desc).take(50)
78 else
79 @tweets = User.find(session[:logged_in_user_id]).feeds.order(tweeted_at: :desc)
80 end
81 erb :timeline
82 end
48 <h3> Timeline</h3>
49 <ul>
50 <% @tweets.each do |t|%>
51 <% op = t.user.name %>
52 <li><%=
53 "<a href=\"/profile/#{op}\"> #{op} </a> : #{t.content}"
54 %></li>
Judging from the error trace, when line 81 calls timeline.erb
, @tweet
is filled with nil
or something. Maybe database issue?
So the TAs can grade it.
As proposed in #4 , root/README.md should be fine.
Need an interface to suggest other users to a user
From Pito: Get more scientific. Instead of randomly trying different things, design some specific experiments and start collecting repeatable data so you can see whether a change improves one thing but might harm something else. Keep up your notes in a text file inside your github repo so it becomes part of your work product.
Make codeship to build && run all tests
user gh-pages
bransh
In timeline.
from Pito: [SCALEEXPERIMENT]Design and execute scaling experiments and see the differences
When I was doing the load testing, I noticed that the second test (loading timeline) was not hitting redis at all. The heroku app has the wrong routing for this. We had made this change last Friday in lab, but it seems like the app that is running on heroku is the wrong version, or the changes were undone somehow. There are also many internal server errors, and it no longer seems like there are the partials.
from Pito: Instrument your nanoTwitter to begin collecting internal performance and timing data. While there are lots of ways to do this, for now, we will use New Relic, which is easiest available directly through Heroku. Figure out how to enable New Relic within your Heroku Configuration and get to know the options.
All unit test for 0.3 pass locally, but fail on codeship.
Not changes to unfollow
, when a user is already following the target. Looks like an error in checking is_following?
logic.
0.1_refactor
is now merged into master
, and I created a new branch develop
.
I think, from now on, we can use develop
to merge working branches, and when things stacked up enough for each point-one milestone, merge develop
into master
as a kind of release.
user/:username
, profile/:username
routings to to show timelinejust small todo's for myself
I think README.md at root will be okay.
from Pito: [CACHING]Consider where to add caching and do some more experiments to see how
when a user logged in
from Pito: [REDIS] Investigate and figure out how to setup a Redis Caching service
found a small bug that not properly getting ids of candidate followers.
results from loader io (and our progress if possible)
From Pito: Update your schema to put indeces and other enhancements and see the effect on scaling
We only have profile/:user_id routing.
From Pito: [nanoTwitter 0.7] Clean up the directory to get rid of any random files. Update your readme.md. Tag the release and update your repo.
from Pito: [CLIENTLIB] Write client libraries for your APIs. This client library could be written in any language, because it’s purpose is to support a programmer who wants to use nanoTwitter’s functionality as a service. For example, if I wanted to write an iPhone app to access all the nanoTwitter functionality, I would incorporate this clientlib in my code. In that case, this client lib would be implemented in Swift. We would call this a “Swift binding” for the nanoTwitter REST API. For this assignment, write the client library in Ruby. Follow the example as explained early in [SODRR].
For a given user, new tweets appear in one order that differs from the order that another user will see their tweets. Ie; User A creates two new tweets (T1, T2), and sees them in their timeline in reverse chronological order (T2, T1, SeedTweetA, SeedTweetB). User B who follows A goes to A's profile and sees the tweets in the order (SeedTweetA, SeedTweetB, T1, T2).
Issue exists in the develop branch.
after some measuring
Instead of having JSON of timeline in redis cache, caching (partial) HTML string might speed things up a little.
I have been using ruby 2.1.7, and so far nothing particularly mattered.
However, while trying to set up hekoru repository, I noticed that they want users to specify the ruby version that an app is built on. I set it to 2.1.7 in Gemfile, however this will cause a bundler problem if you are using ruby other than 2.1.7.
Please let us know which version you are on, so that we can fix the issue now and prevent any further problems.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.