Giter Club home page Giter Club logo

cs105_nt's People

Contributors

keighrim avatar shuchenku avatar vsusaya avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cs105_nt's Issues

0.5 release

From Pito: Update your schema to put indeces and other enhancements and see the effect on scaling

Set up loader.io

[LOADTEST] Investigate and choose a way to load test your app. Use loader.io. Configure your app and heroku accordingly.

Webserver

From Pito: Switch web server from WebBrick; try others, measure.

bug report in nT-0.2

from Tiffany

New class error when running test/follows/1234 (also supposed to be test/follow/1234 just so you know).

Timeline Ordering and "Date"

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 deployment

[HEROKU] Have Codeship deploy to Heroku. Make sure tests still run.

Test for client library

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].

profile/:user_id does not behave as it's supposed to

Orginal requirement

  • Specific user’s page (/user/name or /user/1234) << refered in #16
    • If this is logged in users own page
      • Equiv to logged in root
        • ability to tweet (i.e. equiv to /)
        • Top 50 tweets of followed users
    • If this is not logged in users own page, but user is logged in
      • Button to follow that user (available only if logged in) << refered in #15
    • In all cases, also:
      • User’s profile
      • Link to list of users followed
      • Link to list of tweets made by this user

Current status

When the user is not logged in, it redirect to login/register page.

Internal server error on Heroku

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
app.rb
 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     
timelime.erb
 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?

Load exp design

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.

Codeship

Make codeship to build && run all tests

Scaling experiments

from Pito: [SCALEEXPERIMENT]Design and execute scaling experiments and see the differences

Heroku App not working and was incorrect version

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.

Set up `New Relic`

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.

bug in follow button

Not changes to unfollow, when a user is already following the target. Looks like an error in checking is_following? logic.

branches cleaned out

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.

Replace timeline with profile

  • modify user/:username , profile/:username routings to to show timeline
  • prepare separate erb page for one's tweeting history

Small TODO's

just small todo's for myself

  • link team page to "4 students" in README
  • delete redis instance of partials when un/follow happens

Implement caching

from Pito: [CACHING]Consider where to add caching and do some more experiments to see how

Set up redis

from Pito: [REDIS] Investigate and figure out how to setup a Redis Caching service

v0.1 todos

  1. Get the timeline model to work: Whenever a user tweets, corresponding records get added to the timeline table. Certain records should be deleted when a "unfollow" happens.
    Once that is done, refactor how timeline GET requests are handled.
  2. Login/Sessions
  3. Organize routes

DB schema improvement

From Pito: Update your schema to put indeces and other enhancements and see the effect on scaling

0.7 release

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.

Client library

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].

Tweet order

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.

Change caching

Instead of having JSON of timeline in redis cache, caching (partial) HTML string might speed things up a little.

ruby version

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.