text:
package io.reactivex.netty.spectator.http;

import com.netflix.spectator.api.Counter;
import com.netflix.spectator.api.Registry;
import com.netflix.spectator.api.Spectator;
import io.reactivex.netty.protocol.http.server.events.HttpServerEventsListener;
import io.reactivex.netty.spectator.http.internal.ResponseCodesHolder;
import io.reactivex.netty.spectator.internal.LatencyMetrics;
import io.reactivex.netty.spectator.tcp.TcpServerListener;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import static io.reactivex.netty.spectator.internal.SpectatorUtils.*;

/**
 * HttpServerListener.
 */
public class HttpServerListener extends HttpServerEventsListener {

    private final AtomicInteger requestBacklog;
    private final AtomicInteger inflightRequests;
    private final Counter processedRequests;
    private final ResponseCodesHolder responseCodesHolder;
    private final Counter failedRequests;
    private final Counter responseWriteFailed;
    private final LatencyMetrics responseWriteTimes;
    private final LatencyMetrics requestReadTimes;
    private final LatencyMetrics requestProcessingTimes;

    private final TcpServerListener tcpDelegate;

    public HttpServerListener(String monitorId) {
        this(Spectator.globalRegistry(), monitorId);
    }

    public HttpServerListener(Registry registry, String monitorId) {
        requestBacklog = newGauge(registry, "requestBacklog", monitorId, new AtomicInteger());
        inflightRequests = newGauge(registry, "inflightRequests", monitorId, new AtomicInteger());
        responseWriteTimes = new LatencyMetrics("responseWriteTimes", monitorId, registry);
        requestReadTimes = new LatencyMetrics("requestReadTimes", monitorId, registry);
        requestProcessingTimes = new LatencyMetrics("requestProcessingTimes", monitorId, registry);
        processedRequests = newCounter(registry, "processedRequests", monitorId);
        failedRequests = newCounter(registry, "failedRequests", monitorId);
        responseWriteFailed = newCounter(registry, "responseWriteFailed", monitorId);
        responseCodesHolder = new ResponseCodesHolder(registry, monitorId);
        tcpDelegate = new TcpServerListener(registry, monitorId);
    }

    public long getRequestBacklog() {
        return requestBacklog.get();
    }

    public long getInflightRequests() {
        return inflightRequests.get();
    }

    public long getProcessedRequests() {
        return processedRequests.count();
    }

    public long getFailedRequests() {
        return failedRequests.count();
    }

    public long getResponseWriteFailed() {
        return responseWriteFailed.count();
    }

    public long getResponse1xx() {
        return responseCodesHolder.getResponse1xx();
    }

    public long getResponse2xx() {
        return responseCodesHolder.getResponse2xx();
    }

    public long getResponse3xx() {
        return responseCodesHolder.getResponse3xx();
    }

    public long getResponse4xx() {
        return responseCodesHolder.getResponse4xx();
    }

    public long getResponse5xx() {
        return responseCodesHolder.getResponse5xx();
    }

    public static HttpServerListener newHttpListener(String monitorId) {
        return new HttpServerListener(monitorId);
    }

    @Override
    public void onRequestHandlingFailed(long duration, TimeUnit timeUnit, Throwable throwable) {
        processedRequests.increment();
        inflightRequests.decrementAndGet();
        failedRequests.increment();
        requestProcessingTimes.record(duration, timeUnit);
    }

    @Override
    public void onRequestHandlingSuccess(long duration, TimeUnit timeUnit) {
        inflightRequests.decrementAndGet();
        processedRequests.increment();
        requestProcessingTimes.record(duration, timeUnit);
    }

    @Override
    public void onResponseWriteSuccess(long duration, TimeUnit timeUnit, int responseCode) {
        responseCodesHolder.update(responseCode);
        responseWriteTimes.record(duration, timeUnit);
    }

    @Override
    public void onResponseWriteFailed(long duration, TimeUnit timeUnit, Throwable throwable) {
        responseWriteFailed.increment();
    }

    @Override
    public void onRequestReceiveComplete(long duration, TimeUnit timeUnit) {
        requestReadTimes.record(duration, timeUnit);
    }

    @Override
    public void onRequestHandlingStart(long duration, TimeUnit timeUnit) {
        requestBacklog.decrementAndGet();
    }

    @Override
    public void onNewRequestReceived() {
        requestBacklog.incrementAndGet();
        inflightRequests.incrementAndGet();
    }

    @Override
    public void onConnectionHandlingFailed(long duration, TimeUnit timeUnit,
                                           Throwable throwable) {
        tcpDelegate.onConnectionHandlingFailed(duration, timeUnit, throwable);
    }

    @Override
    public void onConnectionHandlingSuccess(long duration, TimeUnit timeUnit) {
        tcpDelegate.onConnectionHandlingSuccess(duration, timeUnit);
    }

    @Override
    public void onConnectionHandlingStart(long duration, TimeUnit timeUnit) {
        tcpDelegate.onConnectionHandlingStart(duration, timeUnit);
    }

    @Override
    public void onConnectionCloseStart() {
        tcpDelegate.onConnectionCloseStart();
    }

    @Override
    public void onConnectionCloseSuccess(long duration, TimeUnit timeUnit) {
        tcpDelegate.onConnectionCloseSuccess(duration, timeUnit);
    }

    @Override
    public void onConnectionCloseFailed(long duration, TimeUnit timeUnit,
                                        Throwable throwable) {
        tcpDelegate.onConnectionCloseFailed(duration, timeUnit, throwable);
    }

    @Override
    public void onNewClientConnected() {
        tcpDelegate.onNewClientConnected();
    }

    @Override
    public void onByteRead(long bytesRead) {
        tcpDelegate.onByteRead(bytesRead);
    }

    @Override
    public void onByteWritten(long bytesWritten) {
        tcpDelegate.onByteWritten(bytesWritten);
    }

    @Override
    public void onFlushComplete(long duration, TimeUnit timeUnit) {
        tcpDelegate.onFlushComplete(duration, timeUnit);
    }

    @Override
    public void onFlushStart() {
        tcpDelegate.onFlushStart();
    }

    @Override
    public void onWriteFailed(long duration, TimeUnit timeUnit, Throwable throwable) {
        tcpDelegate.onWriteFailed(duration, timeUnit, throwable);
    }

    @Override
    public void onWriteSuccess(long duration, TimeUnit timeUnit) {
        tcpDelegate.onWriteSuccess(duration, timeUnit);
    }

    @Override
    public void onWriteStart() {
        tcpDelegate.onWriteStart();
    }

    public long getLiveConnections() {
        return tcpDelegate.getLiveConnections();
    }

    public long getInflightConnections() {
        return tcpDelegate.getInflightConnections();
    }

    public long getFailedConnections() {
        return tcpDelegate.getFailedConnections();
    }

    public long getPendingWrites() {
        return tcpDelegate.getPendingWrites();
    }

    public long getPendingFlushes() {
        return tcpDelegate.getPendingFlushes();
    }

    public long getBytesWritten() {
        return tcpDelegate.getBytesWritten();
    }

    public long getBytesRead() {
        return tcpDelegate.getBytesRead();
    }

    public long getFailedWrites() {
        return tcpDelegate.getFailedWrites();
    }

    public long getFailedFlushes() {
        return tcpDelegate.getFailedFlushes();
    }
}


text:
New York Comic Con: Dim Sum Warriors iPad Comic Gives a Taste of Chinese Culture
By Olivia B. Waxman Oct. 11, 2012
The sold-out New York Comic Con, which claims to be the largest pop culture event on the East Coast, starts today at New York City's Javits Center and runs through October 14. Attendees will include Kevin Bacon, Carrie Fisher, …
How to Fix RIM: A Twitter Symposium
By Harry McCracken June 29, 2012
Over on Twitter, I asked my followers to provide their best advice on the operating-system strategy which RIM (which just delayed BlackBerry 10 until 2013) should adopt moving forward. "Dump BlackBerry 10 for Windows Phone" seems to be the most popular option…
Your assignment, in 140 characters or less: Should RIM
Flipboard Launches Android Version of Its Popular News Reading App
By Keith Wagstaff June 22, 2012
Good news, Android users. Flipboard has officially made its reader app available in Google Play.
What is Flipboard? Ask someone with an iPhone — nearly 1 million of them downloaded the app after its first week of release, …
SOPA Won't Stop Online Piracy, Would Censor Everyone Else
By Matt Peckham Nov. 17, 2011
Anti-piracy bills in U.S. House and Senate would block sites with infringing content, but empower the government to censor anything it deems unlawful.
The Consequences of Apple's Walled Garden
By Jerry Brito Nov. 14, 2011
At the SysCan conference in Taiwan this week, security researcher Charlie Miller will describe a flaw he discovered in the iPhone's web browser that allows a malicious app installed on the phone to download executable code from …
RIM Launches BBM Music, and It's Doomed Already
By Jared Newman Nov. 02, 2011
BlackBerry maker Research in Motion is forging ahead with its BBM Music offering, an attempt at creating a viral music service that will probably fall flat.
BBM Music launches today with a free 60-day trial, and costs $5 per month thereafter. Here's how it works:
You pick 50 songs for your music library. If you know anyone who's …
Napster No More: Rhapsody Nabs Subscribers, Assets
By Jared Newman Oct. 03, 2011
Napster's long, troubled life is finally coming to an end, with Rhapsody acquiring the service's subscribers and assets from Best Buy. The Napster brand will be phased out as part of the deal.
Napster was best known for its early run as a peer-to-peer music sharing service (read: a way to download pirated MP3s) before the advent of …
Pandora Ends the Tyranny of 40-Hour Listening Caps
By Chris Gayomali Sept. 22, 2011
Remember back in the day when you listened to Pandora and hit your 40-hour listening limit?
"Wait, what? No more music?" you ask, brow furrowing as you slowly remove your earbuds. "Geez, 99 cents? For an entire month of streaming radio that I can customize as I please? Does it LOOK like I'm made of money?"
(MORE: Which Music …
Who Needs Hulu? NBC Adds Free TV Shows to Its iPad App
NBC's iPad app just got a lot more useful with full episodes of popular shows like Community and Parks and Recreation. Both the app and the TV episodes are now free.
The selection of full episodes in NBC's app isn't too shabby. For primetime, scripted TV shows, the five most recent episodes are available. Late Night with Jimmy Fallon …
YouSendIt Now Offering Cheap, Unlimited Dropbox-style Storage
By Chris Gayomali July 26, 2011
Despite a smattering of bad press thanks to some security loopholes, Dropbox remains one of the most widely used services on the web, now with over 25 million users. The way they got there is simple, really: Not only were they one of the first to offer free cloud-based storage, but they streamlined the process to make storing and sharing …
Survey: Bing Closes On Google, Wikipedia Beats Facebook, Fox News Reigns
The American Customer Satisfaction Index (ASCI) is a national survey conducted by the University of Michigan that evaluates customer satisfaction with a number of businesses annually.
In the internet sector, they've looked at and ranked three different types of services—social media, search engines and news sites—to determine …
Hands-on with Spotify: Promising, with Let-Downs
By Jared Newman July 07, 2011
(UPDATE: Spotify has clarified that the software made available to me is the U.K. version of the service, not the U.S. version. Therefore, things may change before launch, and these should be considered early impressions.)
Spotify's U.S. launch has been a long time coming, and now it's nearly here. Although the subscription music …

redpajama_set_name: RedPajamaCommonCrawl


text: Q: Авторизация пользователей Есть сайт - интернет-магазин, написанный по технологии ASP.net MVC. Доступ к базе данных осуществляется через wcf-сервис.Для сайта нужно сделать авторизацию пользователей. ASP.net identity тесно связан с Entity Framework и требует прямого соединения с базой данных. Как мне сделать авторизацию и где хранить данные пользователей при условии, что база данных находится за wcf-сервисом? Проект чисто учебный.

redpajama_set_name: RedPajamaStackExchange