Circuit-Breaker status in Turbine Dashboard - hystrix

Turbine dashboard is used to aggregate Hystrix metrics stream from a cluster of nodes. The Circuit-Breaker status is displayed on the Turbine dashboard as Open or Closed.
What is the logic used for arriving at the Circuit-Breaker status for the cluster? Does it represent the status of the Circuit-Breakers in the majority of nodes from the cluster, or is it some other logic based on time in a state, % of nodes, etc.?

If all hosts are in the Open state, then the text will be green and display Open.
If all hosts are in the Closed state, then the text will be red and display
Closed.
If some hosts are in the Closed state then the text will go orange and display how many are in the Open state and how many are in the Closed state.
It looks something like:
{Open: 1, Closed: 4}
The logic behind this can be seen in the source of the Hystrix dashboard hystrixCircuit.html

Related

How to modify firebase database so that i can set a read or unread status

I need to show the count of unread messages from firebase in the notification bell.
I am done with displaying all contents in my collection in my web application.But when a new message arrives i need to give a feedback to user by showing the unread message count in notification bell .From my understanding,for that i need to set a read/unread status in firebase collection.Is there any alternative way for showing the count of unread messages in my React Web Application?
i am using firebase package of npm for displaying messages.
Below is the sample data in my firebase collection.
name:"John Doe",
message:"you got a new appointment"
i am new to firebase.Please help me with some logic to sort out this problem.
If I understand correctly, you would want to use a status flag (read: boolean), unless you would not mind writing all new messages to a particular path and moving them to another path after it is read.
Something like below
/user/unread-msg => all new messages come here
/user/read-msg => messages are moved here after being read.
This I believe would be less efficient than using a simple flag.
You could use a firebase cloud function to maintain the count of child elements in a particular path like /user/unread-msg or /user/read-msg so that you don't have to download the entire data to get the count.
Refer the sample code at https://github.com/firebase/functions-samples/tree/master/child-count

Handle data with react (API request once or more)

I'm currently developing an web app to keep track of cash flow. Every day an employee counts the amount of coins in the checkout and enters the respective amounts in a form called "Protokoll". These "Protokolls" are displayed in a list which is fetched from a node server. When an item is clicked a new request to the server is performed to get the amounts and display them in a form.
My question is: What is the best/correct way to handle my data?
Should I request the data once when the list is loaded and then pass the respective data to the clicked item or is it okay to use my current method, where the data is fetched again for each individual item?

React Native: Marking posts a user has seen on his activity feed

I am implementing an activity feed similar to facebook or twitter's. I fetch newsfeed items in batches of x(I use RelayJS, x is the pagesize of connections). However, it may so happen that due to eager loading in the List View a lot of items are fetched for the news feed but the user doesn't scroll to the end to view them. How can I determine what news feed items a user has really seen so that I don't repeat them and only show the newer ones and the ones down below that were fetched but not shown to the user when he refreshes or opens the app next time? The easier solution is to discard all the x items that had been fetched as seen.
How is this info stored? A table of numUsers X numItems with booleans? A set of such items?
It depends a lot on your implementation. The most simple one would be return to the user only the information generated after their last login.
Now, if you want to actually keep track of the information that was actually seen by the user then I guess that is a lot more complex. Like storing every item ID and a flag to check if the user has seen it.
Then you can make a clean up on app close that will mark that very first item that you need to show them that they haven't seen. For example:
1 Not Seen
2 Not Seen
3 Seen
4 Not Seen
5 Not Seen
6 Seen
7 Seen
8 Seen
9 Seen
Upon closing the app, you store that you need to show them starting on the ID 5.

Add additional data to order information during checkout process

I have prestashop website and during the checkout process when choosing the carrier I added a dropdown which contains additional information about shipping when you choose the certain carrier.
More specific: one carrier provide "self-service parcel terminals" service, where customer have to choose the final shipping destination(address) from where he'll pick up the product. The dropdown list contains about 30 choices.
I added dropdown with carrier information as a module and hooked it in hookDisplayBeforeCarrier hook.
How should I save this data into database and then display it in backoffice in orders section?
To fulfills your requirements, you need to use following hooks of PrestaShop.
processCarrier - To save the selection in a cookie or something temporarily
hookNewOrder - To fetch and save the selection into database on order place
displayBackOfficeHeader - To display the selection in back office order details.

Automate daily collection of weather station data from NCDc

Here is the link to where the data can be found. Scrolling down to Surface Data : Daily and selecting the Global and U. S. Web Page Icon. On the next page, Select the radio button Country and press continue. From the next page's drop down menu, select any state and then press the radio button for entire state (I need more than 100 stations per day).
The next page allows you to select the date range.
I am dumping these data files into excel and sorting (which is a pain, since it could obviously be
automated).
Is there a way I can access the most current data via a script (VBA or otherwise)?
My main problem is that I can't send the server a simple request to obtain the data. Also, there is an FTP site but only allows .gz files to be downloaded, each over a gig, so its not reasonable for my situation.
Any help would be appreciated!
There National Climatic Data Center has several data APIs available for this.

Resources